The bit with the lid on is the reservoir, and this sits on top of (and feeds into) the master cylinder - you’ll notice there are two feeds in from the reservoir - one for each braking circuit, usually one front wheel and the back wheel on the opposite side, to prevent total brake failure if you had a ruptured line and pumped all the fluid out. At the front of the master cylinder is a big black round thing - this is the servo, it’s “just” a rubber diaphragm which has a vacuum “sucking” on one side from the engine that then multiplies the effort of you pushing the pedal - have a look for a YouTube video, as it is really simple to watch but hard to explain as clearly!
Changing the master cylinder isn’t too bad of a job if it’s quite high up in the system, as it limits the amount of air that can get in and need to be bled out, likewise the servo can be removed, opened and inspected to see if the seals are good - I’ve never had much luck rebuilding them with new diaphragms so tend to replace them, if they’re leaking/have fluid on the wrong side.