Unions aren’t a bad deal. Unions using government as a club to clobber businessmen is a bad deal, but unions certainly have their place.
For example, in an ideal Capitalist society, remember, government regulatory bodies would not exist (see also: OSHA). Sure, it’s in the best interest of a businessman to keep his factory in safe working conditions. But having his men organized amongst themselves (and maybe with other men who do similar work in other factories) provides a means to understand safety issues and to bargain for the alleviation of some elements of danger. There are arguments to be made from efficiency as well…
Unionism falls apart when you take away the coercive element. Your example of understanding safety issues might have held true in the past, but information technology makes it simple to get the word out widely on safety risks involved with industries and particular workplaces. OSHA would be replaced by safejob.org, or some other organization providing this info for fee (I made that up, but it happens to be a site that does something similar today, though publicly funded). The bargaining to alleviate some elements of danger would take place at wage negotiations, where the individual would weigh the risk against the benefits and require higher pay for more dangerous jobs. The employer would weigh the higher cost of labor against the cost of eliminating dangers and choose accordingly. As long as the dangers are well understood and communicated, this is the most efficient way to make those decisions. If the employer hides risks from employees, then he is committing fraud. Once discovered, the legal system can extract compensation after the fact.
As SN points out, the only time that unions can have any effect, without coercion, is when the higher value workers are willing to sacrifice some of their benefit to lower value workers. The effect would be similar if those high-value workers simply gave some of their wages to low-value workers. The difference is that with unionism, high-value workers become average-value workers when their wages are limited to the average, and overall productivity, profitability, employment and wealth are all reduced for all levels of worker.