How Do Hydraulic Brakes Work?
Hydraulic brakes work by amplifying the force applied at the master cylinder and thus providing superior stoping power when compared to cable brakes. This works by using a small diameter master cylinder and a larger diameter slave cylinder, as can be seen in Figure 1. The smaller diameter master cylinder allows for a high system pressure to be generated, where the larger dimeter slave cylinder then effectively amplifies the force due to the difference in surface area. Force = Area x Pressure.
Like with all things in this world, it's not possible to get anything for free! One of the compromises is that the slave cylinder will not move as far, Work Done = Force x Distance and it is only possible to get out what is put in, less frictional losses etc. 
Hydraulic fluid can be considered as being incompressible at the pressures it is exposed to in hydraulic system applications. This characteristic is what gives the nice responsive feel associated with hydraulic brakes.
As can be seen in the simplified diagram Figure 2, hydraulic brake systems consist of; a master cylinder, reservoir, brake hose/pipe and the slave cylinders.
The reservoir is responsible for coping with minor leaks, the extension of the slave cylinders as the brake pads wear and also provide a space for the brake fluid to expand into when the fluid temperature increases.
Modern mountain bike brakes commonly have 4 cylinders, however 2 and 6 cylinder configurations are also available. An increase in the number of cylinders essentially multiplies the surface area of the slave cylinder and, therefore, the force that can be applied to the disc relative to the force applied master cylinder.
Why Do I Need To Bleed My Brakes?
The rubber/plastic that components such as seals and the brake hoses are manufactured from allow the migration of atoms/compounds through its macro structure, thus, contaminants (such as water) can find their way into the brake fluid. This can detrimentally effect the properties of the fluid.
Having water in your brake fluid is bad news as it can lower the boiling point of the brake fluid. This is a problem because during use a lot of heat is generated from the friction of the brake pads against the brake disc, some of this heat manifests in the brake calliper and, therefore, heats the brake fluid within. If the boiling point of the brake fluid is surpassed then the brake fluid can boil within the system causing cavitation. The cavities of gas (vaporised brake fluid/water) are compressible and, thus, will make the brakes feel spongey and will reduce effectivity of the brakes. This is not something you want mid way down a trail! , , , , .
How Do I Know When To Bleed My Brakes?
Sponginess of the brake lever is normally an indicator that a hydraulic brake system requires bleeding. The brake lever may feel spongey before riding, which could be an indicator that there is air in the system, however, the brake lever may feel firm until a period of sustained breaking, this could be an indicator of water contamination within the system.
In the ideal world brake fluid should be changed at regular intervals, sponginess of the brake lever can lead to a dangerous occurrence, especially when unexpected. As explained previously, water ingress to DOT brake fluid is not dependant on how much you ride the bike, it is the migration of water through the rubber/plastic based elements of the hydraulic brake system over time. . Normally it is recommended that you change brake fluid in automotive vehicles every 2/3 years, however, given that mountain bike brakes experience harsh use and are expected to perform at their best every run, it would be sensible to bleed the brakes more frequently than this. , , .
Another reason to change brake fluids regularly is that contaminants can accrue in the fluid, due to component wear (such as the seals and the master/slave cylinders), which can further accelerate deterioration of the seals and hoses etc. .
What Oil Do I Need?
SRAM uses and advocates DOT 5.1 fluid for the Guide/Code mountain bike brakes brakes, however, Shimano has opted to use mineral oil. There are a few advantages that DOT 5.1 brake fluid has over mineral oil which are as follows:
DOT 5.1 is less compressible than mineral oil. ;
Although DOT brake fluid absorbs water, the boiling point of DOT 5.1 brake fluid does not tend to deteriorate less than 180 degrees Celsius. (Mineral oil does not absorb water and so if enough water enters the hydraulic system, the boiling point of the water can become the limiting factor). ;
DOT brake fluid is manufactured to meet a specification created by the US DOT (US Department of Transport). The fluid is Glycol based (See Figure 3 below) and the standard has been widely adopted throughout the automotive industry. , .
The different DOT brake fluid standards identify the levels of refinement and the associated boiling points:
The 'dry' and 'wet' boiling point terms are defined as follows:
Dry - The boiling point of fresh brake fluid with no water absorption;
Wet - The boiling point after water absorption of 3.7% by weight.
Glycol ether compounds bond with water via a H bond. See Figure 5 below showing how water integrates with DOT brake fluid. A H Bond occurs when the positively charged Hydrogen atom is attracted to a negatively charged Oxygen atom from a different molecule. A water molecule can polarise enough (positively charged at one end and negatively charged at the other) to make an ionic bond of sorts with another molecule, this phenomenon is responsible for 'water tension'. , .
Step By Step Guide
In this guide we have used the SRAM Guide RSC mountain bike brakes.
What Tools & Materials Do I Need?
DOT 5.1 Brake Fluid;
SRAM Bleed Kit (NOTE: The newer generation callipers use a 'Bleeding Edge Adaptor' (more on this later.);
Torx Bit (T8 & T10);
Allen Key (2.5mm & 4mm);
Waste fluid container;
1) Remove the applicable wheel.
2) Remove brake pads, circlip and bolt along with the pads and place somewhere free of contaminants. Be careful not to contaminate the pads with any oils, as the pads will not grip the disc as well after contaminated, therefore, the performance of your brakes will be poor after reassembly.
3) Push slave cylinderback into the body of the brake calliper using your Rotae Tyre Lever Set pad separator as shown in Figure 6.
If you don't have a tyre lever to hand you can use a screw drive but be very careful as the slave cylinders are very fragile. We recommend that you use something soft made of plastic.
4) Once the slave cylinders of the brake callipers have been retracted into the body of the calliper install the bleed block as shown in Figure 7.
The purpose of this is to ensure the volume of the fluid in the system is correct. If you were to bleed the system with worn pads in place you risk contaminating the pads with oil, furthermore, when you come to replace the pads you might find you can't retract the pistons enough to fit the new pads in.
5) Prepare the syringes by screwing on the appropriate adaptors and filling with fluid.
The syringe to be connected to the reservoir on the lever assembly should be roughly 3/4 full, this is the fluid that will be pushed through the system to purge any air and old fluid. See Figure 9 below.
The syringe that is to be connected to the calliper should be filled with a small amount of fluid in order to minimise the risk of any air being sucked into the calliper. See Figure 8 Below.
Remove any air from the syringes by holding them upside down, placing a cloth over the end that will be connecting to the brake system and slowly squeeze until all the air floats to the top and is removed from the syringe. You shouldn't have to waste a lot of fluid in this process.
Once done then close off the the syringe with the clip on the hose as shown in Figure 10 and wipe the syringe clean.
NOTE: There are two different types of connector for the SRAM brakes, the threaded connection, and the 'Bleeding Edge Adaptor' shown in Figure 11. The 'Bleeding Edge' connector simply pushes into the calliper body and seals on the O-ring. It is then possible to open and shut the bleed port without having to disconnect your syringe, meaning there are less chances for spillages!
6) If your brake calliper uses the 'Bleeding Edge Adaptor' then you will need to loosen the bleed screw with an allen key (4mm) prior to connecting the 'Bleeding Edge Adaptor'.
If not then remove the bleed port screw.
7) Connect the syringe to the brake calliper as shown in Figure 12. This is where you will need to use the 'Bleeding Edge Adaptor' if applicable.
8) Before proceeding ensure all master cylinder adjustment is wound all the way out . See Figure 13. The lever position should also be adjusted so that the end of the lever is roughly 75-80mm from the bar.
9) Once both the syringe at the calliper and the syringe at the lever assembly are connected, the syringe hose clamps can be opened ready for bleeding.
10) Now for the bleeding process itself. If your brakes use the 'Bleeding Edge Adaptor' ensure the brake calliper bleed port is open by rotating the 'Bleeding Edge Adaptor' anti-clockwise 1 turn as shown in Figure 14.
Gently push down on the syringe plunger connected to the lever assembly, whilst simultaneously pulling up on the syringe plunger connected to the calliper as shown in Figures 15 & 16.
NOTE: During the bleeding process the syringes should be held upright to prevent air entering the brake system.
The syringe connected to the lever assembly should be depressed until the new brake fluid comes out at the calliper bleed port, this is typically visible when looking at the clarity of the fluid being expelled. Normally this should occur before the fluid runs out in the syringe connected to the lever assembly.
This will push the old fluid, air and other contaminants out of the system.
11) Proceed to pull the plunger on the syringe connected to the lever assembly out, drawing fluid back up the system as shown in Figures 17 & 18. This will draw any air out of the lever assembly and top end of the hydraulic hose.
NOTE: When doing this be careful not to suck air into the system from calliper syringe.
12) Once the system has been fully purged close the bleed port on the calliper using the 'Bleeding Edge Adaptor' if applicable. See Figure 19.
If your calliper uses a normal threaded connection then close the syringe hose clamp, remove the syringe and install the blanking screw for the calliper.
13) With the syringe connected to the lever assembly held upright, squeeze and release the brake lever until air stops rising out of the lever assembly. The lever should pull right to the bars without significant resistance at this point.
14) Now push and pull the plunger on the syringe connected to the brake lever assembly as shown in Figures 20 & 21.
Repeat this process until air bubbles stop rising out of the lever assembly.
15) Push the plunger down on the syringe connected to the lever assembly firmly and release to normalise the system pressure. The bleeding process is now complete.
16) Close the syringe hose clamps on both syringes and disconnect them, reconnect the blanking screws and bungs where applicable and clean everything up with a rag.
TIP: Cotton buds can be used to get to the hard to read places as can be seen in Figure 22.
TIP: It pays dividends to use some degreaser to clean the lever assembly, calliper and any other component the brake fluid may have come into contact with. DOT brake fluid will destroy paintwork!
17) Re-install the brake pads and wheels being careful not to contaminate any brake surfaces with grease or brake fluid.
18) Test your renewed brakes!
How Do I Dispose Of My Used Brake Fluid?
It is important that you dispose of your oil correctly as it can be harmful to the environment. Most recycling centres/rubbish tips will accept small amounts of oil (brake fluid will fall into this category). Simply bottle up your waste fluid and take it down the tip the next time you head that way!
 - BBC Bitesize. 2020.Work, Power And Efficiency - Work, Power And Efficiency - AQA - GCSE Combined Science Revision - AQA Trilogy - BBC Bitesize. [online] Available at: <https://www.bbc.co.uk/bitesize/guides/z8pk3k7/revision/1> [Accessed 24 April 2020].
 - EBC Brakes. 2020.Brake Fluid. [online] Available at: <https://ebcbrakes.com/articles/brake-fluid/> [Accessed 24 April 2020].
 - Podoprigora, N., Dobromirov, V. and Stepina, P., 2018. Method of assessing the influence of the moisture content in the braking fluid on the braking system actuation efficiency.Transportation Research Procedia, [online] 36, pp.597-602. Available at: <https://www.sciencedirect.com/science/article/pii/S2352146518305027> [Accessed April 2020].
 - Cars.com. 2020.How Often Do I Need To Change My Brake Fluid? | News From Cars.Com. [online] Available at: <https://www.cars.com/articles/how-often-do-i-need-to-change-my-brake-fluid-1420680336417/> [Accessed 24 April 2020].
 - Carid.com. 2020.When Is It Time To Replace My Car’S Brake Fluid?. [online] Available at: <https://www.carid.com/articles/when-is-it-time-to-replace-my-cars-brake-fluid.html> [Accessed 24 April 2020].
 - Brayleys.co.uk. 2020.How Often Should I Change My Brake Fluid? | Brayleys Cars. [online] Available at: <https://www.brayleys.co.uk/blog/how-often-should-i-change-my-brake-fluid> [Accessed 24 April 2020].
 - SRAM Technical Service FAQ. 2020.Why Did SRAM Choose DOT 5.1 Over Mineral Oil?. [online] Available at: <https://sram.zendesk.com/hc/en-us/articles/226533828-Why-did-SRAM-choose-DOT-5-1-over-mineral-oil-> [Accessed 24 April 2020].
 - Machinerylubrication.com. 2020.Brake Fluid - A Practical Guide. [online] Available at: <https://www.machinerylubrication.com/Read/30614/know-brake-fluids> [Accessed 24 April 2020].
 - Epic Bleed Solutions. 2020.What Is Meant By Wet And Dry Boiling Points Of Brake Fluid?. [online] Available at: <https://epicbleedsolutions.com/blogs/faq/what-is-meant-by-wet-and-dry-boiling-points-of-brake-fluid> [Accessed 24 April 2020].
 - Essex Parts. 2020.| Essex Parts Services, Inc. | Essex Parts Services, Inc.. [online] Available at: <https://www.essexparts.com/news-blog/brake-fluid-wet-or-dry-boiling-point-which-is-more-important> [Accessed 24 April 2020].
 - Epic Bleed Solutions. 2020.DOT Brake Fluid Vs. Mineral Oil - And The Winner Is... [online] Available at: <https://epicbleedsolutions.com/blogs/articles/dot-brake-fluid-vs-mineral-oil> [Accessed 24 April 2020].
 - Govinfo.gov. 2020.Standard No. 116; Motor Vehicle Brake Fluids.. [online] Available at: <https://www.govinfo.gov/content/pkg/CFR-2018-title49-vol6/xml/CFR-2018-title49-vol6-sec571-116.xml> [Accessed 24 April 2020].
 - Biblioteka Nauki. 2016.The Research On Ageing Of Glycol-Based Brake Fluids Of Vehicles In Operation. [online] Available at: <http://yadda.icm.edu.pl/yadda/element/bwmeta1.element.baztech-d256533a-c02e-4ec9-ad04-9dc4d7c352be> [Accessed 24 April 2020]
 - Nhtsa.gov. 2020.LABORATORY TEST PROCEDURE FOR FMVSS 116 Motor Vehicle Brake Fluids. [online] Available at: <https://www.nhtsa.gov/sites/nhtsa.dot.gov/files/tp-116-04.pdf> [Accessed 24 April 2020].
 - Iopscience.iop.org. 2020.Shieldsquare Captcha. [online] Available at: <https://iopscience.iop.org/article/10.1088/1742-6596/13/1/102/pdf> [Accessed 24 April 2020].
 - Socratic.org. 2020.Why Is The Surface Tension Of Water Higher Than That Of Ethanol? | Socratic. [online] Available at: <https://socratic.org/questions/58f9030bb72cff445def3c2c> [Accessed 24 April 2020].
 - Servicearchive.sram.com. 2020.MTB Disc Brake Hose Shortening And Bleed Manual. [online] Available at: <https://www.servicearchive.sram.com/sites/default/files/techdocs/gen.0000000005245_mtb_disc_brake_hose_shortening_and_bleed_rev_d.pdf> [Accessed 24 April 2020].