Viruses are extremely small. The Coronavirus is 0.1 to 0.5 microns in size. In comparison, a human hair is 50 to 180 microns. They are so small that they can go through masks like pollen can go through a chain-link fence. In theory, masks are supposed catch the tiny droplets of moisture that the coronavirus clings to.
But for masks to be any effective it has the be the right kind of mask, preferably N95. That automatically rules out cloth masks, which are useless. It has to be fit-tested to be effective. You are not supposed to touch the mask only the loops and nose of the bridge. You are not supposed to reuse the same mask. You shouldn't wear the same mask for too long, otherwise the pores in the mask become blocked by moisture from breathing, and the air stream simply diverts around the mask. Even if you do everything just right there are no guarantees.
That's why masks are pretty much useless for the general population. No one ever does any of those things. They are always touching their masks or wearing it below their nose. In fact, they probably touch their face more when they have a mask than when they don't. The general public is never going to do everything correctly as a trained medical professional would, and we shouldn't expect them to. The late Dr. Donald Henderson agreed. He was epidemiologist who helped to eradicate smallpox worldwide. He believed masks should only be worn by trained medical professionals in a hospital setting. The real world is a far cry from the controlled environment of a hospital.
We don't have to guess if masks work or not. By now we have a year's worth of data that proves masks are not very effective. We can compare the states that had mask mandates to those that did not and there's not much difference between the two in terms of Covid cases. In fact, the states that had no mask mandates or severe lock-downs sometimes fared better than those that did.