The number of microphones in each earpiece varies by AirPods model.
And yes, the “beam-forming” is intended to make the microphone audio pick-up directional.
Microphones have been using directionality for a long while, such as with the three microphones on most (all?) recent iPhone models; the bottom near the speakers, top front, and near the main camera lens array. The front and back (or bottom and back) microphones allow the phone to (mostly) differentiate ambient noise from your speaking voice.
AirPods Pro are fairly good at damping external noise, yes. Not quite as good as over-the-ears like Bose QC35 series, or (presumably, haven’t had the opportunity to try them) AirPods Max. Continuous noises such as fans or motors are well-muted, and local conversations are reduced by AirPods Pro.
You can hear ambient right through AirPods 3.
Depending on your particular ear canals, Beats Fit Pro might be another option to consider.
I have used both AirPods Pro, and Fit Pro, and there are things I prefer about AirPods Pro and like less about Fit Pro, but Fit Pro stay in my ears (far) better. Some folks have no problems with AirPods falling out while moving around. Others do. My AirPods Pro left will fall out if I’m too active, having achieved proper fit test and the rest. Fine while seated, but not while exercising.