It's like this. You have a certain amount of people.
X amount go out and about. Mask mandates give you the delusion that you are safe going out because you have a mask and most others have masks. So, 2X amount of people go out because of mask mandates giving you that false sense of security.
If you stayed home and didn't go out much, let's say that 1,000 people would test positive.
If twice as many people go out because they feel safe wearing masks, then 1,500 would test positive.
If the same twice as many people go out, none of them wearing masks, then 2,000 would test positive.
So, yes, masks work to a degree. But, since more people are going out with mask mandates because they feel invincible with masks on, more test positive than if these people didn't go out much.
This is the reason why cases rose during mask mandates, because more people were out and masked people spread the virus. Masks don't actually decrease case numbers if you had just stayed home, they actually increase case numbers because more people are out spreading the virus.