Hydraulic disc brakes are one of the best things to have become widespread on bicycles in the last decade. They're powerful, have great feel and require very little maintenance when setup correctly due to being a sealed system. Setting up hydraulic brakes is called bleeding, and it's the process by which you remove air from the system. The reason you need to do this is that air is compressable while hydraulic fluid is pretty much the opposite, so the more air there is in the brake system the more inconsistent and 'spongy' your brakes will feel.
The trouble is, bleeding is often seen as a one-size-fits-all solution to almost any problems you might have with your hydraulic brakes. But in reality there are only certain situations that you need to bleed the brakes, while other symptoms will actually require other remedies (like changing the pads, for example). In the below video Truman and Calvin from Park Tool talk you through 5 things that mean you need a brake bleed and five things that don't. It's a really useful guide and well worth a watch.