A switch looks very similar to a router but the network function it performs is different. In simple terms, switches facilitate a direct communication path between devices on the network. Switches efficiently direct data packets to destination by keeping track of network hardware addresses for each device (aka: Layer 2 MAC addresses. .ie. a1:b2:c3:d4:00:af)
This is a vast improvement from the days when HUBS were the only network equipment we had to connect network end points. Hubs were very inefficient because all data packets were repeated on EVERY port. And, network end points had to take turns to send/receive traffic.
Switches are also used to enlarge the internal local area network. You can almost think of them acting similar to an electrical outlet strip. You can use an ouletstrip to multiply the number of available socket on a wall outlet from 2 to 8 (or more).