team stacking is problem in pretty much all team games. more from people preferring one side or map imbalance (which further deepens the problem but isn't the main issue), it stems from actual players.
let's break them down into 3 groups to understand a bit more what causes stacking in games like RO2 (but it applies to any MP game with large teams):
the average majority: most of the players you meet ingame belong here. they vary in skill a lot, from complete beginners that don't know what they should be doing, useless players that sit on spawn trying to snipe people with rifles (as rifleman being the better case scenario), to decent players that might not kill a lot, but they will try to get in the cap zones, resupply mgs and generally be helpful. they might even prefer one faction over another to the point when they will join one side exclusively. so what all these actually quite different players have all in common you ask? despite most of the server is them, they themselves don't cause any imbalance or stacking, and while saying they don't matter at all in that regard would be an overstatement (it would be possible to have one team full of monkeys and other one of above average players, the chance of that in normal games is basically zero), it's pretty close and regardless of their individual quality, most important thing is that they just are there.
so now that we know that despite having as much as ~64 players on the server, and majority not being relevant to stacking, who is then? the 2 other groups.
game makers, game changers, "heroes" - however you want to call them, one thing that applies to all of them is they are very good at the game. they will most often have high honor and/or be heroes ingame and they will regularly be on top of the scoreboards. however, it doesn't work the other way around and every player that does this isn't necessarily this kind of player. so what's the difference between very good players and "game makers"? game makers are able to put so much pressure on enemy team alone that there are able to single-handedly turn the tide of the battle, not necessarily because they are able to play 1v32, but because they play so well and efficient that they, just like the ingame heroes, increase the morale of the team and suddenly, the "average majority" becomes "above average majority" and you have a cause of imbalance. however, since you sometimes have these people on each teams, or since such player can join the losing team for the sake of challenge, it often balances out, or rather, it would balance out if there wasn't the third group:
actual stackers, or "mud": these are the players that actively join the winning team, either because they just want to win for the sake of winning or having good w/l ratio (doesn't matter nobody else will ever see it), or worse, they don't like being stomped so they'll switch sides when losing, since it's more fun steamrolling than being steamrolled right? there are 2 things that make the matters even worse, and thus are the result which make the game not slightly imbalanced, but complete domination of one side by the "stacked" side. first is, logically people leaving the weak side and joining the stronger side cannot lead to anything else than even weaker losing side and even stronger winning side. the most important issue however, is that these stackers are often pretty good players that would seemingly appear as if they belong to the group above (they'll have good scores, lots of kills and high rank). the big difference is though that their performance will be heavily affected by the overall strength of the team, which is why they'll look like amazing players in stacked teams, but they won't change much in losing team (hence they'll usually switch sides afterwards), while the actual "heroes" will still do really well despite playing against a lot stronger team, which of course doesn't really matter in the end when everyone else who is decent changes sides.
and that's the problem in a nutshell, when otherwise good players find losing boring and instead of accepting the challenge, they switch to the winning side causing complete steamroll. when you add poorly designed maps to the mix and 1 side generally preferred by some players for whatever reasons, it just makes everything even worse. fortunately campaign mode slightly balances this out by having the winning team attack, but even that isn't often enough. and having all these nice stats in menu that are completely irrelevant, but motivate people to have good stats rather than bad ones doesn't help, since now, every game you ever lost is tracked (again, doesn't matter nobody else will see it, it's still right up there for you), so might as well switch teams before the match ends. nobody wants to look at stats and see he sucks.