In any organisation, it is sensible for the boss to listen to the workforce. And often, a convenient way of doing this is via the trade unions.
So, there is a mutual benefit in the unions and local councils having a relationship. One example is in keeping the number of agency staff to a minimum. This makes sense for councils, as agency staff are expensive, and it is a nuisance for residents always having to deal with different people. Reducing the number of agency staff is also in the interests of the unions, in terms of their scope to recruit more members.