Apartment entrance intercom
There are a lot of varieties of these systems. The more modern ones work over phone lines, and a phone line (POTS) is just two wires.


Intercom is actually a small computer with a directory of names
Select a name and the intercom dials the phone number associated with that name, hopefully ringing a phone in the correct apartment
When you answer the phone and press a button on your phone, the intercom detects that button via DTMF and triggers the latch to open the door (typically an electromagnet).


However, older systems may work differently - e.g., using separate buttons and wires to trigger the door opening mechanism instead of DTMF signaling.