What does the ability Contrary do? I want to finally understand why this makes Serpirior good.
Contrary reverses your stat changes.This means that when you're supposed to lose stats, you actually gain them, and vice versa. This means if Serperior uses Swords dance with the ability contrary, its attack will actually go down two stages instead of up. This also applies to your opponents attacks. If you use screech on a Contrary Serperior, its defense will go up two stages.
The reason why this is so popular competitively is that he can use leaf storm with it. You take a base 140 move (210 after STAB) and its effect drops his special attack two stages...but thanks to that ability, it will raise it two instead, meaning you get a powerful STAB move with a beneficial side effect.