Network socket is a core of the Internet communication. Socket is a link between request (client) and response (server) on lowest level provided you by the machine/OS.

Sockets are associated with specific combination of:
You open a socket over network when you want to establish a connection, then you receive some data from the server and, depending on protocol (like HTTP), you decode it or use a ready library.
socket() and similar functions in all programming languages are similar to fopen(), they return you a pointer you use in other functions to send/receive data through this already established connection.
Image from difference between socket programming and Http programming