What is the difference between a hub and a switch?

A hub sends incoming data to all connected ports, while a switch sends data only to the intended device. A switch is usually more efficient and is the better choice for most modern networks.