It "works" because, legally speaking, it's the employer who decides when you can take vacation. Apart from some edge cases, the employer has the option to give your full vacation in one go but it also has the option to give it to you in two different periods (at most). No period may be smaller than 10 days. They have to notify you of your vacation period at least 30 days in advance.
In practice it really depends where you work.
In some jobs you will have a lot of latitude, and the employer will let you freely choose and only veto it if it's really disruptive (like everybody else in the team leaving at the same time). This is what I had experienced, working in IT.
I suspect that in some lines of work, like the service industry, you might be totally out of luck and have zero choice on the matter.