Unions also many times (especially with "guild" type unions) can serve other valuable functions like guaranteeing a higher minimum quality of work (generally).
Guild-style unions seem to be about setting and enforcing cartel pricing, not work quality. At least for the construction and remodeling subcontractors I encounter.