Let's say you have a friend who always agrees with everything you say. If you say "I like pizza," your friend says "I like pizza too!" If you say "I don't like broccoli," your friend says "I don't like broccoli either!"
In grammar, something similar happens with "polarity." Basically, "polarity" means the "direction" of a sentence - whether it's positive or negative.
So, if you say "I like pizza," the polarity is positive - you're saying you like something. If you say "I don't like broccoli," the polarity is negative - you're saying you don't like something.
Now, here's where it can get a bit tricky. Sometimes, changing one word in a sentence can change the polarity. For example, if you say "I never eat pizza," the polarity is negative because you're saying "never." But if you say "I always eat pizza," the polarity is positive because you're saying "always."
And there are rules about how polarity works in sentences. For example, if you have a negative word like "don't" or "never" in a sentence, other words in that sentence will have to be positive to balance it out.
So, just like with your always-agreeing friend, in grammar, we have to pay attention to whether a sentence is positive or negative - that's what "polarity" means.