TCP is the protocol that ensures reliable transport delivery when used together with the IP protocol. Other duties TCP performs is the operation of ensuring packets are maintained in the right order, and that delay is kept to a minimum level. TCP also prevents packets from being duplicated, to ensure that all data received is consistent, in order, complete, and smooth.
TCP is in the transport layer of the OSI model, so it applies its functions to packets before they’re passed on to the IP layer. TCP will put datagrams into TCP packets before sending to the IP layer where they’re encapsulated into IP packets. Data that is broken is is done so into bits placed into packets then transferred over the network. Once the packet reaches it’s destination the bits are reassembled into the original piece of Data.