Put simply, ESCs (or Electronic Speed Controllers) take signals from the flight controller and current from the battery and tell the motors what to do.
Traditionally these have been 4 separate little circuit boards secured to each arm of the quad between the flight controller and the motor but there's a move to have a 4-in-1 ESC that stacks below the flight controller, safely tucked away in the middle of your frame. A 4-in-1 ESC is better protected from prop strikes but if one ESC blows for some reason, the whole board needs to be replaced.
Just like the flight controller, ESCs run firmware and currently that’s either BLHeli_S or BLHeli32. Both do a fantastic job but BLHeli32 is 32bit, faster, lower latency and it has a few nifty, but gimmicky features like playing music as a startup tone for sample. There are plenty of great quality ESCs running both firmwares and you’ll find BLHeli_S a little cheaper as the firmware is open source, BLHeli32 isn’t.
ESCs are rated by their power handling capability - typically somewhere between 20 and 30Amps. You’ll also see a second, higher number attached to them and that’s their “burst rating” - it just means they can take a bit more than rated but not for too long. Bear in mind that bigger motors with more aggressive props need a higher Amp rating and as higher rated ESCs don’t cost very much more, you may as well aim a little higher than you think you need.
Newer ESCs support newer features like the digital protocol DSHOT, telemetry and more but as with everything in this hobby, more innovations are just around the corner.