The union is a nice backstop for issues around the edges that come up with corporate, but the real backstop is the pilots’ licensing. By making them directly responsible for the plane as PIC, it gives them leverage over their employer that few other professions have. AIR-21 gives them significant protection from retaliation and the ASRS is confidential. ALPA helps them navigate that mess if it comes to it, but that’s the real legal backing that pilots have.

Same thing happens with Professional Engineers regardless of whether they are employed or work as independent consultants/firms. They’re legally responsible for the bridges and other infrastructure they sign off on with laws protecting them from employers and clients.

(I fully support the ALPA and other unions, I just don’t think it plays as significant a role in following regulations as you claim)