Which is not to say that all unions are well-behaved. My time as a Teamster was both instructive and discouraging. They had secured a lot of provisions that I don't think should have been allowed to stand. For one, joining the union was a condition of employment. If that requirement didn't violate the principle of free labor markets, it at least cut close to the line. And they eradicated all traces of meritocracy; the only thing that could ever be rewarded was seniority. That was deeply discouraging for a new employee, and from the company's perspective it ensured that the highest-paid employees were also the least productive, by virtue of having spent the most time observing that hard work would never be met with any reward aside from itself.
However, we should not throw the baby out with the bath-water. Unions should be allowed to exist; history is rife with practical examples what happens if you don't do so.
And frankly, the potential problems posed by unions can naturally be addressed by the free market itself, if only we'd let it. If a company's compensation structure becomes unsustainable due to more efficient competition from another company, then it is absolutely OK to simply let its more efficient competitors out-compete it. That remains the case regardless of the cause of the unsustainable compensation structure.