There is a good chance that you didn't know or have never heard of N95 masks. Even I didn't know anything about them, prior to March 2020. Upon hearing about them, you might think, like I did, that N95 mask are a lot like a strainer or a mesh of fibres which is too small for dust and other airborne diseases to get through. A strainer essentially filters out particles larger than its opening and not particles smaller than its opening. Which is what we expect out of a mask, that after a certain point, smaller particles will get through. But that is where we are wrong.
The particles N95 masks filter out are generally much smaller than the gaps between the fibres in the mask. What's unique is that masks are generally very good at filtering out the large and small particles, it is the medium sized particles that cause trouble. This isn't at all like a strainer because N95 are much clever – genius. The ultimate goal of a mask is to get the airborne particle to touch its fibre. It once touches the fibre and stays stuck to it, thus, preventing it from becoming airborne again. This isn't anything special about the fibres but the size of particles. At a microscopic level, everything is sticky because of the weakly attractive force between objects ["Van Der Waals Force"]. Therefore, more the layers of mesh, more are the chances of the particles sticking to it.
Whether the particle will hit the fibre and stick to it, largely depends on the size of the particle. Large particles, > 1 μm, travel straight in air due to their inertia and tend to hit the mask's fibres. Small particles, < 0.1 μm, are so light that collision with air molecules make them travel in a literal zig-zag pattern ["Brownian Motion"] and make it very likely that they will collide with the fibres ["Capture by Diffusion"]. Particles in the in-between size are the hardest, ~ 0.3 μm. They don't travel straight and they don't bounce off the air molecules. Instead they travel along the motion of air and can travel past fibres and sneak through even a mask of many layers.
But N95 masks have an advantage in this case. They can attract particles using an electrostatic field. Even neutral particles, develop an imbalance which attracts them to the source. Fibres are like permanent magnets but for electricity. This makes N95 mask so good at what they do. Large Particles ~100% Block. Small Particles ~100% Block. Precisely, the amount of medium particles the mask blocks gives its rating. In this case, N95 mask blocks ~95% of medium sized particles.