The theoretical reasoning behind unions is that they counteract the market power of companies over employees.
If this market power assymetry doesn't exist (for example software engineers in San Francisco), unions are not beneficial to the society but at least slightly beneficial to the average union member assuming the union is making good decisions. Because more market power is always better than less market power. It's always advantageous to be a monopoly.
If you're a highly productive employee, the company doesn't have market over you, you can easily find another job. But this may be different for an average employee.