We take our ability to browse web pages, share documents will co-workers and watch live video online for granted. In order for this communication to work, billions of packets of data are transferred through computer networks, both internally and externally. Here is a basic run-through of how computer networks operate.
Computers are identified on a network in two ways, there is an IP address and there is also a unique physical address known as the Mac address. When two computers on the same network want to communicate, the data is sent from one to the other by a network switch. The network switch forwards the data from one computer to another based on the Mac address.
When communication with an external network is required, the data along with the IP address of the computer is sent to the gateway of that network. This is usually a firewall device. This device then forwards that data to the external network device or server. These are usually smart devices and can remember which data came from where so when a response arrives, it is sent back to the computer that sent the original request. The external server or device can be seen of as a website or another service online.
While this is a rather simplistic look at how computer networks transmit information, it is an accurate representation of what happens every time we do something on a network or on the internet.