Masks are not 100% effective. Indeed, at it's height the hope was only to slow the spread to manageable levels, the spread was inevitable.
There's of course still a small chance of contracting COVID-19 in spite of wearing a mask, which is why for society at large masks only slowed down the spread at best. For the individual person by and large the probability for getting infected is negligible, though.
This precisely what those - quite heated - arguments (and pertinent studies) regarding masks being not effective at all were about: Masks are highly effective on a personal level; for preventing community spread their usefulness is limited.