I know that when objects are connected and a force is exerted on the connected objects, we treat them as a system with a single acceleration.

I was just wondering if objects were piled on top of each other they would still be connected. if a horizontal force was exerted on one of the objects, would it apply to the entire system?