Tor works like a chain of proxies, where each proxy only knows about the next hop and the previous hop.
Simplifying a lot, when your computer sends data using Tor, your tor client will encrypt the payload, and forward it to another node. The next node does the same, and after a few iterations your packet reaches the exit node, is fully decrypted, and sent to the destination webserver.
The webserver sends the packet to the exit node, because the exit node was the computer that connected to the webserver. The exit node uses a table (seems like the NAT table, but with more information) to decide where to send the response. So it will encrypt the packet again, and send it to the next node, which will do the same, until the packet reaches your computer, are decrypted locally, and sent to the application.
The intermediate nodes don't have to wait for all the data before sending it to the next hop, or downloading files several MB big would be a hassle. Instead, they have a limited buffer space, and every time the buffer fills (or a timeout occurs), they encrypt it and send it ahead.
Your application will think the remote server is your tor client, so it only have to acknowledge the packet transfer until the first node. The destination webserver thinks the exit node is the client, and all intermediate nodes will acknowledge the packets between them, as there's a point-to-point connection between then.