In addition to the hydraulic brake system, all cars have a robotic brake applied to both wheels - usually the rear wheel.
If the hydraulic system fails completely, the hand brake will provide limited braking, but its main purpose is to act as a parking brake.
The hand brake lever pulls a cable or a pair of cables connected to the brake through a set of smaller levers, pulleys and guides, the details of which vary from car to car.
Once the ratchet on the hand brake lever is applied, the brake remains open. The button is released from the ratchet and releases the lever.
On drum brakes, the hand brake system presses the brake lining against the drum.
Disc brakes sometimes have comparable hand brake arrangements, but since it is difficult to place the links on a compact caliper, there may be a completely separate set of hand brake pads per disc.