It varies because different industries and corporations have different power relationships with their employees and potential employees. If you work in tech, for example, then your statement of 'happy workers are a good long-term strategy' might be generally true, and you will work harder to retain talent both because supply of people who have the required skills is below demand and both losing an employee and taking a new one on is expensive due to the value of the institutional knowledge they hold. These workers hold a lot of power over their employer (both individually and as a whole), and they know it, so they can demand good compensation and treatment and get it.
However a corporation which has a large amount of jobs which require little skill or job-specific training but a lot of effort may actually find the opposite is a good long-term strategy: they have a vast supply of potential employees and hiring and firing is cheap so they can work their employees hard to the point of burn-out and then fire and rehire the next batch. These workers have basically no power over their employer individually. Unions are effectively a way for these workers to exercise some power over their employer as a collective, to get what some workers essentially have automatically due to the labour market in which they work.
However a corporation which has a large amount of jobs which require little skill or job-specific training but a lot of effort may actually find the opposite is a good long-term strategy: they have a vast supply of potential employees and hiring and firing is cheap so they can work their employees hard to the point of burn-out and then fire and rehire the next batch. These workers have basically no power over their employer individually. Unions are effectively a way for these workers to exercise some power over their employer as a collective, to get what some workers essentially have automatically due to the labour market in which they work.