depends on your definition of "work" really. remember how steve jobs infamously told apple users to "avoid holding your iphone 4 this way"?
wearing masks is a measure, and as such it is evaluated at being effective given all the shortcomings and ineptitudes in the general population, rather than in lab conditions. in other words, mask efficiency is not just "% of infection prevention", it's really, in VERY broad strokes,
mask efficiency = "% of infection prevention" * "% of population wearing them properly" * "% of population picking proper materials" * "% of population replacing/washing them properly"
now THAT is a much lower number than just the first factor alone!
in a similar vein, vaccine efficiency is not just "% of infection prevention", it's really
vaccine efficiency = "% of infection prevention" * "% of vaccine does properly produced and packaged" * "% of vaccine doses properly stored and transported and administered", etc.
what you kinda really care about is the final number after all factors have been taken into account, and actions to mitigate their effect as well that have been taken as well. if that number is too low after everything else, welp, then masks don't work, even if they kind of do. otherwise, see steve jobs' quote above.