Also if workers go on strike they don't get paid by their job, the union can pay them something instead from fees they received in the past.
The theory is that the threat of legislation is sufficient to prevent imbalance between the parties. The state takes on the role as antagonist, making the unions and employers (somewhat uneasy) partners in trying to self-regulate. If they fail, parliament legislates, which is generally speaking perceived as an undesired outcome by everyone (crucially including most political parties).
From my Swedish point of view the model seems to work for private local employers, but struggles with the globalized tech workforce and for some public sector employees. It also seems to complicate work visa compliance by hiding away some of the terms.