I have been around this business for a long time (watched with interest the debates on the Deregulation Act, first on cargo, then on pax airlines, for example...). I have been a union organizer, I have chaired committees, served on national committees, and worked in airline management.
Under the Railway Labor Act, having a contract for the pilots actually protects both sides in a number of ways. Pilots also have to abide by the contract (they sometimes forget that part). Those that argue against the RLA do not know the history or the full implications of it.
The other part is that, when an airline gets big enough, the management is actually easier with the union than without. While this might not apply to non-pilot work groups, for pilots, the issues become complex quickly. While the pilots are not management, per se, they do have to act as managers of their aircraft and crew, including, often the ground and support people. The lack of ability to directly supervise them creates problems if you do not have a fairly rigid operating framework. In the military, you get that, but in the civilian world, you do not automatically have that authority.
You need some framework that is more formal than is possible in the typical civilian company, as the stakes are a lot higher. The union creates checks and balances in the system. I certainly do not agree with all the positions either side takes. I have seen the management pushing for things that would increase safety, and the union arguing against them because it would adversely impact some of the members, so it's not all about safety (sorry, but that's the truth, many examples but not for this thread). However, the pilots need to have their collective interests and positions raised. Could you imagine the complication of having 5000 or more professionals all contacting management with their point of view, how that would be?
You do not have a supervisor for each small group, like other employee groups, and, if you did, you'd have to have several hundred pilot managers, all with the experience to understand the problems, who would report to how many senior managers, etc. It would be cumbersome, and expensive to manage that way. Much better to have a single spokesperson or focal point for the pilots.
What the union is also providing is a check, and sometimes it protects a bad management team from itself. Furloughing a pilot, for example is not like laying off someone in most positions due to the extremely long spool up time to get someone requalified, but a bad management team might take the short term view to the company's long term detriment. The union also forces the pilots to be very loyal, as their fate is tied to their company. This is good for management.
The union also can be instrumental in promoting professional standards, which are policed by the group itself, which gains the company higher quality, more professional employees. This is essential in a large company where there is no way to supervise the pilots in any direct way.
That said, there are some bad parts of the union. You tend to have volunteers that are mad at the company, which is not good, and there is a tendency for the union reps to paint a bleak picture to get more support, just as happens in our political system with certain organizations. Not sure how to fix that, but you need to be aware of it. Unfortunately, those that are fairly happy do not tend to want to spend their free time volunteering. I think it should be a mandatory part for everyone's career, a couple years on the union side, and a couple on management, would make people see things for what they are, maybe.