I usually do nothing to avoid stacking, but if my ally ship wants to switch sides, that's totally cool. If I've got a crew I like, I don't care who I'm fighting, stacked for us, stacked for them, as long as I'm playing.
About 70% of the matches I'm in are stacked. Rarely is this intentional, but this is an example of what I see most often.
I join a mostly empty lobby and grab a captain slot. The other team has a level 1-3 pilot with a similar crew, and an empty ship beside them. After a bit, a higher level 6-9 pilot joins in on the other team, sees that his ally is a low level, sees that I'm a higher level, and switches teams to be on my side.
I don't think this captain is doing this to be a dick, he's doing it to win, and I'd do the same thing. If however I'm already in my spot and a low level captain joins my side, I'll stick with him. Everyone wants to fly with higher levels because it increases their chances to win. All levels are guilty of it.
The time I don't see stacking is with multi level clans fighting each other. I'd much rather fly alongside a low level fellow Cake than a high level pilot I don't know.
I use pilots as examples but the same applies to all classes.