The primary responsibility of the Transport layer is to make sure that all the data gets to the other computer. This is done by numbering each packet sequentially before sending it. The Transport software on the other computer takes an inventory of the packets as they arrive. If any of them get lost in transit, it requests that the missing packet be resent.
The Application layer hands the data to the Transport layer as a stream. The Transport layer subdivides the data into packets and its counterpart on the other machine turns it back into a stream.