Here are some of the ways that you can unlock car doors:
In some cars that have power door locks, the lock/unlock switch actually sends power to the actuators that unlock the door. But in more complicated systems that have several ways to lock and unlock the doors, the body controller decides when to do the unlocking.
The body controller is a computer in your car. It takes care of a lot of the little things that make your car friendlier -- for instance, it makes sure the interior lights stay on until you start the car, and it beeps at you if you leave your headlights on or leave the keys in the ignition.
In the case of power door locks, the body controller monitors all of the possible sources of an "unlock" or "lock" signal. It monitors a door-mounted touchpad and unlocks the doors when the correct code is entered. It monitors a radio frequency and unlocks the doors when it receives the correct digital code from the radio transmitter in your key fob, and also monitors the switches inside the car. When it receives a signal from any of these sources, it provides power to the actuator that unlocks or locks the doors.
Now, let's take a look inside an actual car door and see how everything is hooked up.