A switch is used to connect multiple computers via a LAN cable with each other so they are able to communicate with each other.
These computers need to be in the “same network” to be able to communicate with each other.
Example:
“Computer 1”: 192.168.0.1/24
“Computer 2”: 192.168.0.2/24
But a “Computer 3″ with the IP 192.168.1.1/24 can’t communicate with”Computer 1” or “Computer 2” because it is located in another subnet. See subnet and netmask for more details.
A switch can’t control or change the network flow like a router.
Theoretically you can compare a switch with a power distributor.
Source: https://de.wikipedia.org/wiki/Switch_(Netzwerktechnik)
Licence: https://creativecommons.org/licenses/by-sa/3.0/