Hub, simply broadcasts data to all connected devices. Switches, on the other hand, connect devices within a network and enable efficient data transfer using MAC addresses. Routers connect multiple networks and determine the best path for data transmission based on IP addresses. Each device plays a unique role in network communication, with hubs offering basic connectivity, switches facilitating device-level communication, and routers managing network connectivity.