Well, it does. Any mask, no matter how thin or poorly worn, gives some protection from other people's sneezes coughs, and even talking. Complete protection? Of course not. But definitely more protection, and the less you inhale, the less chance of bad results.
Think about "say it, don't spray it". Would you rather encounter a sprayer with your mask on or without?
There's a long article about particles in air at https://www.ncbi.nlm.nih.gov/books/NBK143281/ but the short of it is that they can be there long enough to get you.