A Link Made of Cable or Radio
The first thing that has to happen is a connection. A printer can be connected to a computer through a cable, almost always a USB cable, plugged directly into the back of the machine. It can also connect wirelessly, usually by joining the same Wi-Fi network as the computer, or by pairing over Bluetooth on smaller devices. Either way, what is being set up is a path along which information can flow in one direction: from the computer to the printer.
The Driver: A Translator in the Middle
A document on your screen is not in a form a printer can understand. The printer needs instructions about where ink or toner should land, line by line, dot by dot. The piece of software that handles that translation is called a driver. When you install a printer, you also install its driver. When you hit print, the driver takes the document and turns it into a precise stream of instructions in a language that particular printer speaks. Different printers speak different dialects, which is why each model needs its own driver.
Sending the Job and Printing the Page
Once the document has been translated, the computer sends it down the connection to the printer. The printer holds incoming jobs in a small queue, so several prints from one or more computers can wait their turn in order. As soon as the printer is ready, it reads the instructions and recreates the page — moving the print head across the paper, putting ink or fusing toner exactly where the driver told it to. The result is a paper copy of something that, until a moment ago, only existed as light on a screen.
Source
This article was written using information from Wikipedia.