in a time of N-95 mask scarcity, something likely to continue because the needs of hospitals and other health settings are simply not being met. Civilians are going to have to rely on fabric and surgical masks.
Worn by an infected person, the masks will stop all but the smallest droplets. Worn by an uninfected person, the WHO compliant fabric mask or a surgical mask will stop some of what's left. The idea here is to reduce viral load, the amount of exposure a healthy person faces. Keeping viral load low to reduce the possibility of severe disease is a model that applies to other viral illnesses. We don't yet know if it applies to Covid, but it's the best we've got.
Yes, the N-95 masks are the only ones that offer real protection, but those need to be reserved for people who are dealing with known cases of Covid.
Here is an article on the effectiveness of various types of masks with bonus gross video (second one down). https://www.sciencealert.com/this-home-experiment-shows-why-even-homemade-masks-can-help-stop-covid-19-spread