• What’s a hub?
• Problems with hubs
• What’s a switch?
• What’s a router?
A hub and a switch are pretty similar, just that a hub blasts a packet that it receives out on all of it's ports.
A switch knows which MAC-address(es) are connected to which port and thus only forwards the packet on that port.
That avoids collisions and prevents packet-sniffing. The first is good for network-performance, the second good for security, but bad for some cases of network-monitoring/-analysis.
These two devices connect devices of one network with each other. A router on the other hand connects two or more networks with each other by providing a gateway from one network to the other(s) (for example your local network to the Internet). Usually this involves some sort of network address translation (NAT), usually S-NAT (source-NAT) which alters the source-address of a packet (to that of the router, for example from the local IP of your PC to the IP assigned to your router by your ISP).
Feel free to ask more questions if necessary.