TCP is connection-based. You establish a connection between two hosts, and then send data over that. The protocol guarantees that data arrives whole (any packets lost are automatically re-sent) and in order, but obviously, this comes at a price - managing and re-establishing the connection, re-sending the packets et cetera takes some time, so TCP is generally slower than UDP.

UDP is connectionless. Kinda like snail-mail, you just slap an address on a packet and hurl it into the vast void of the network in hope that whatever intermediate servers will be able to successfully forward that to desired destination. Downside is that, obviously, the packets may get lost or arrive out of order. But this also an advantage - if you send player position data over the net, you always want the latest data. If an old packet gets lost anyhow, there's no need to resend, because you probably got fresher data, anyway. And if old data arrives later than newer data - you can insert a timestamp into packet data, then compare timestamps and ignore all old packets coming in.

On LAN, TCP should suffice, as the ping on local network will most likely be <1ms anyway, and you get all that guaranteed data integrity benefits. Heck, on low ping networks you can even do this the archaic way: send player X packet to player Y, and don't advance the game for player X until he gets the packet from player Y.