Because the virus particles travel on other things, and those other things are big enough to get blocked.
It is particles that are around 0.3 microns in size that filters have the most difficulty blocking. N95 particles block 95% of particles of 0.3 microns in size. N99 Masks block 99% of particles at 0.3 microns.
As I understand it smaller particles get ‘stuck’ in the maze of fibres and are statistically unlikely to find there way through the mask. The best analogy I can think of is a spec of dust finding its way into a centre of a huge labarynth that is vibrating randomly in all directions (and coated in honey). Some respirator masks also contain anti viral coatings and are electrostaticaly charged.