Hub: This hardware device is to route the network packets from one machine to all the machines on the Local Area Network. This is a dumb device and sends the packet to all the machines in the network.
Switch: This hardware device does the same thing as Hub except that it is a smart device and keeps the Mac address of all the connected devices. It can figure out which packet is meant for which device and only sends to that device instead of broadcasting it to all devices in the Local Area Network.
Router: This hardware device is to connect devices from one LAN to another LAN.
This video is very good to summarize the above.