Or it can do nothing of the sort, instead negotiating things like non-competes, options exercise window, etc. See screen writers or actors unions for examples.
I'm in europe, unions are mandatory everywhere, some are good, some are not, average just do what the company wants them to, usually the 2-3% raise every year.
Unions don't really work for software, high demand, low supply of people, here you can negotiate better then without one, and if you are not happy, next job.
They aren't mandatory everywhere, atleast in germany.
You can join the union or not. If you don't join you can still take advantage of the union negotiated rates or not if you wish. If you think you can negotiate better than the union you're still free to do so.
Or it negotiates yearly raise brackets.
You can negotiate better individually if you are good and there arent union enforced guidelines, if you're not, the union deal would work out better.