Medical masks protect in two ways. One, they filter the air at an extremely high level. Two, they are fluid resistant, so the saliva droplets that are filled with virus particles cannot penetrate the mask.
Most health organizations, including mine, are noticing that COVID prevalence within their employees is less than the local population as a whole despite being around contagious COVID patients all day long. The major difference in these two populations is that health care workers are wearing medical masks.