Most of the time, when you need some work done on your brakes, the only parts that need to be replaced are the brake pads and maybe the rotors that the brake pads rub against. But there are other parts in the brake system so don't be surprised if your mechanic says you need some of them replaced.
Here are a few examples:
When you press on the brake pedal you are actually taking brake fluid that is in the master cylinder under the hood and pushing it out in all directions to the brakes on all four wheels. If the seals inside of the master cylinder go bad it won’t supply good pressure to the brakes and it needs to be replaced.
Brake fluid can deteriorate over time, but its biggest enemy is moisture. If it absorbs moisture, the boiling point of the fluid is reduced. That's important because your brakes can get extremely hot. If the fluid isn't in good shape, you run the risk of having brake failure under severe braking conditions.
Rubber hoses carry pressurized brake fluid to the front wheels and they flex constantly when you drive. Like any other rubber part they deteriorate over time. Having one of them burst while driving is not a good thing, so don't be surprised if your mechanic recommends replacing them, especially if your vehicle is over seven years old or so.
Parking brake cables connect the parking brake handle to the rear brakes. The cables can wear out over time and get rusty from all of the corrosive slop out on the roads. Your mechanic should check the parking brake system every time they check your regular brake system, just to make sure that it applies and releases without binding up.
Wheel cylinders are used on drum brakes and they push the brake shoes out when you apply the brakes. If the seals inside of these cylinders fail, brake fluid leaks out causing a low brake pedal and ruining the brake shoes.
Antilock brake sensors are located near the wheels and they measure the speed of the wheels. Those sensors can wear out and the wires going to them can become damaged as well. If you have an ABS light on you might end up needing to replace at least one of the ABS sensors.
Calipers and hardware hold the brake pads in place and squeeze the pads against the rotors when you apply the brakes. When you let off the brakes, the piston needs to release the pressure and the caliper needs to move back to release the brake pressure. If any part of the caliper or the hardware is binding it usually has to be replaced.
As you can see, there are a lot of brake parts over and above the pads and rotors. Keeping the brake system in good working order isn't cheap sometimes, but you should never cut corners when it comes to something as important as your safety and the safety of others.