It's evident that mask can reduce transmission of virus.
If you drop a few milliliters of water on a mask, most of water stays on the mask without penetrating.
When we consider that saliva flying from mouth is similar to this water, it's understandable that wearing mask is effective for preventing virus infection.