The technology in a fax machine is pretty simple.
A bright light reflects off the document as it passes along a strip containing hundreds of tiny photocells.
If a white area of the page passes below, the photocells convert the light shining off the document into electricity. If the area is black, the photocell generates no electricity.
These impulses fire off in quick succession and are converted into sound signals that travel over the telephone lines. The fax on the other end “hears” the signals and interprets where the black should print.
If it’s a thermal fax, tiny pins, corresponding to the hundreds of photocells, heat up to match the black areas of the original document. The heat activates those sections of the heat-sensitive paper, turning it black as it passes by.
That’s how most home fax machines work. However, there are other variations like plain paper fax machines, which use the same idea but with a laser or inkjet printer instead of heatable pins.