Derailleurs are one of the most complex components on a mountain bike. The derailleur "derails" the chain, allowing the rider to shift the chain from gear to gear by use of the handlebar-mounted shifters.
While front derailleurs are beginning to fall out of use thanks to the increasing popularity of SRAM's 1x11 drivetrain and other 1-by conversions, many mountain bikes still feature front derailleurs. The front derailleur changes the front chain ring gears.
The rear derailleur is a point of constant refinement in the mountain bike industry. In recent years, perhaps the most important advancement is the proliferation of clutch-style derailleurs. The "clutch" puts additional tension on the chain, which consequently helps reduce chain slap and keeps the chain from jumping into the incorrect gear.