There are two main uses for the term socket in computing.
In some cases, though, relevant components can vary between individual computers.
The CPU, however, is a little different.
Instead of being mounted so that its circuit board is perpendicular to the motherboard, it is parallel.
This means that a standard slot wont work.
Instead, it needs to fit in a socket.
The socket design is intrinsically related to the design of the CPU.
The physical dimensions of the socket must match the CPU.
While this is standardized for socket generations, it theoretically could be arbitrarily changed.
Many smaller sockets for standard microchips have integrated retention mechanisms.
You could also consider female electrical connectors, such as a USB port or a socket.
In computing, female electrical connectors are generally referred to as ports.
In electronics, however, they are often referred to as sockets, so both uses are correct.
This is done over networks and the Internet.
To be able to communicate, a computer process needs to open a web link socket.
On the software end, this information is represented as a unique ID known as a socket identifier.
A socket must be associated with a communication protocol, i.e., TCP, UDP, and IP.
This allows one configured local socket to listen to multiple connections at once.
This relies on the service dedicating a thread to each active connection.
Each received packet is handled in order.
This doesnt work with the connectionless UDP.
Sockets like this may even be used for non-web connection communication.
For example, inter-process communication also uses sockets.
While these essentially function the same, the actual linking is different as it doesnt use networking protocols.
Conclusion
The term socket has two meanings.
One refers to an electrically female connector with two large dimensions, i.e., distinct from a slot.
Historically sockets were used to mount several microchips on motherboards.
Sockets can also refer to connection sockets.
These are local identifiers.