A switch is a device that allows two or more devices to be connected together. A socket is a type of switch that allows one device to be plugged into another device, usually through an opening in the middle.
Switches and sockets come in different types depending on what you need them for. There are three main types of switches and receptacles: switched, Normally Open (NO), and Switched-N/O. Keyed switches allow you to custom set which devices can connect to which ports, while normally-open switches allow any device to be connected to any port without the need for a switch. Finally, sockets come in two flavors: male and female. Male sockets allow devices to be plugged directly together, while female sockets help connect multiple devices together by providing a hole through which they can pass.