The role of the brake master cylinder is to convert the mechanical energy input by the pedal into hydraulic energy.
The principle is to control the liquid in the hydraulic cylinder through the brake pedal. The liquid expands in a fixed direction. The friction plate tightly clamps the wheel brake disc to achieve braking. Of course, the liquid will contract the brake friction when braking is not required. The disc will move away from the brake disc.