All the unions I have watched organize in local government were created because employees no longer wanted to be subject to the whims or lack of leadership of elected officials. A union prevents newly elected officials from getting rid of everyone so they can re-staff with people they choose. And it prevents elected officials from playing around with the income of employees because they don't want to pass the cost of doing business along to citizens who benefit from the services.
But I have seen examples of this that were both a benefit and a detriment to government. It's a benefit when it prevents professional, hard-working people who have a lot of knowledge about the agency from being fired for no good reason. In these cases everyone who worked and knew how to manage the agency is let go and replaced by people who usually have no background in government. Unfortunately citizens do not view this as a problem because there is a strange and fundamentally incorrect public perception that it is so easy to run a government that anyone can do it. But basically it is a multi-million dollar operation upon which our whole community depends. Getting rid of everyone in an agency is like firing everyone from a hospital and hiring all new people who have no experience in the medical field. It creates chaos for about four years until some of the people start to figure it out - many never do. Which brings me to the negative effect of the union. It is always a bad thing when the union protects a poor performing employee who was only hired by a past elected official as a favor to one of their friends. This employee never tries to figure it out - they know they don't have to. And other employees leave them alone because if they don't, they risk getting in trouble from the elected official.
As for the salaries, because government is a multi-million dollar operation upon which we all depend, we need professional people there who know what they are doing. (It always surprises me that the public seems to have so little concern in wanting to make sure educated, experienced, and professional people are hired/elected to oversee the management of their tax dollars and their community.) But to hire people like that, government has to pay at least close to what industry pays or they will not attract the people they need to run efficiently and effectively.
The other side of this is that it costs money to run a government - our agencies are faced with the same costs of doing business as everyone else. So when costs go up, rates or taxes must go up or the government can't pay bills. Unfortunately, it's easier for elected officials to neglect to give cost of living raises or to fund pensions than to pass a rate or tax increase or cut their special projects/programs. So this brings us to the problem today - elected officials are trying to subsidize the cost of running government with employee salaries and pensions rather than cut their special projects or programs or raise taxes or rates. So employees organize to try to prevent this poor management decision. The only negative side I have seen with this is that some unions manage to negotiate wage increases or benefits that are not reasonable. And again, that is the fault of the people at the negotiating table - most of the time, the elected officials.
The other solution I have seen elected officials propose to avoid this whole situation is out-sourcing, but in most cases, for daily operations, it is more costly to outsource than to have staff. What elected officials fail to consider is that in outsourcing, they are still paying wages, pensions, benefits, etc but now they are also paying a profit. For example in our state, for state-funded engineering contracts, the state and local government are paying cost plus almost a 3X multiplier. But this method is accepted by the public because they don't see the wage cost - only a bill from a company. They don't understand that with in-house staff they see all the actual costs while with a bill from a company they don't see the wage and benefit costs and costs not normally paid by government for in-house work. Such as the cost to maintain a much nicer facility than government would have maintained, bonuses, marketing costs, etc.
Anyway, the solution is probably sitting down in a reasonable manner in a workshop environment trying to target exactly what services are essential and need funding and then coming up with a reasonable salary/benefit structure. When the majority is reasonable, this works, but too often, I have seen when the majority, on both sides, is not willing to give up their own agenda for the good of the public.