Hydraulic systems are like boxing; simple in concept, complex in execution. A braking system works by transferring the mechanical motion of your foot into hydraulic pressure and then back into mechanical movement at the brake caliper. But if you're wondering how the calipers retract when they're done, then you're certainly not the first.
How a Brake System Works
The top of your brake pedal connects to a metal rod, which connects to a piston in your fluid master cylinder. When you press on the brake pedal, the piston pushes fluid through your system and into the slave cylinders in your brake calipers. The slave cylinders are generally at least twice as large in diameter than the master cylinder, which means they will hypothetically move half the distance but express twice the pressure that you exert on the master cylinder piston.
A brake slave cylinder would exert twice the pressure and move half the distance if there were only one of them, but all cars have at least four. That means that the slave cylinders will actually move 1/8 the distance as the master cylinder piston, which itself has a stroke of one to two inches. Thus, the slave cylinders only physically move 1/8 to 1/4 of an inch at most. Since the cylinder pushes on both sides of the calipers via the slider mechanism, most maximum clearance between the pad and disc will only come in at a maximum of 1/16 to 1/8 inch.
Most brake slave cylinder seals don't slide so much as they do flex. The seal is something like a spring, pushing the cylinder back into its starting position as soon as pressure releases from the hydraulic system. This, combined with the slight negative pressure exerted by the retracting master cylinder piston, is what pulls the cylinder back into place after application. Of course, that depends on the master cylinder design, since many simply pull fluid from the reservoir instead of exerting negative pressure. Often times, this movement is so slight that the pads never fully lose contact with the rotors or drums, and if they do you'd have trouble squeezing a playing card in between the pad and rotor surface.
The slave cylinder's main ring seal doesn't generally move in the bore unless a mechanic manually compresses it with a clamp. The sliding seal's primary purpose is to allow the cylinder to adjust for pad wear without falling out of the bore. As the pads wear, the cylinder has to extend further in order to keep the pads in contact with the rotor. After replacing the pads, the mechanic uses a clamp to shove the cylinder piston back into the caliper body to make room for the new pads.