there is a print head has nozzles to draw ink from cartridge and spray on the paper cartridge is placed on the print head holes are placed exactly on the nozzles.
There are various technologies involved, depending on the make.
The ink is supplied at the nozzle by internal pressure from within the cartridge, or by gravity.
The ink is fired onto the paper by an electrical pulse. This impetus is provided either by rapidly heating the ink drop, or by piezo crystal resonator.
As the print head moves back and forth across the paper, the picture is printed line by line.