Most brake systems use a layout very similar to that seen here, comprising the pedal, a booster, master cylinder, hydraulic lines and hoses, and calipers or wheel cylinders that apply pressure to a pad coated in friction material so that it pushes against a rotating disc or drum. Clicking on any of the links will take you to an animation explaining how it works, and highlighting the common failures for each part.
The purpose of the system is to convert the energy of the moving vehicle into heat in order slow the vehicle down. Although some hybrid vehicles are beginning to convert kinetic energy into stored electricity, all vehicles still use a brake system similar to that shown here. The pressure from the drivers foot (with assistance provided by the vacuum booster) is initially converted into fluid pressure in the brake lines by the brake master cylinder. Brake fluid is a hydraulic fluid that is stable in volume under a wide range of temperatures - it does not expand as it heats up. The pressurized brake fluid forces the pistons in the brake caliper outwards, so that they press against brake pads. The pads squeeze the surface of the rotating brake disc, causing it to slow, and generating heat. The heat is dispersed through cooling fins inside the rotor to prevent the rotor and pads from overheating.