Both devices (hubs and switches) are used to connect computers/network devices together or a home/local area network.
Here is a picture of a 5 port Ethernet switch but by looking at it
you can’t actually tell the difference between a hub and a switch.

To understand the subtle difference between the two then you need to understand a little about the Ethernet protocol.
Ethernet is a shared media protocol which originally used coax cable as the connection media, but now UTP (unshielded twisted pair) is the more common.
What this means is that if you have 20 computers connected to the
network only one can use (send to) the network at any one time. while the one computer is sending the other computers have to wait.
They effectively listen for the computer to stop sending, and if
they have something to send then they try to send it, if another
computer tries at the same time then you have a collision.
The real world analogy is a group of people talking.
If the computers are connected with a hub then the rule of -one
computer sending at any one time holds.
However a switch is more intelligent than a hub and will allow more
than one device/computer to send at the same time
Because of this a network comprised of switches instead of hubs is
usually faster but a lot depends on the network configuration and use.
Related Articles and Resources
- Understanding Hubs and Switches
- Using the Ping Command to test your network by Pinging IP addresses.
- Finding IP Address-How to Find the IP Address of a windows Computer
- Internet and Networking Components- Internet and Networking Components for connecting to the Internet.
- Wireless Internet Connections
- Wi-Fi and Wireless Networking
- Wireless Setup on Network Devices