As others have noted, this is perhaps a more common feature of software engineering jobs. I would say it works because engineers already tend to have a lot of flexibility with scheduling and how their work is evaluated, not to mention variance in the perceived value + volume of work performed by each person.
What prevents someone from taking a 3 month sabbatical every year? Well, reviews. It's pretty hard to do a full-time position's worth of work in 9 months, and your boss will let you know that you have fallen well short of expectations at review time (or just in your regular 1-on-1 meetings). So, in a sense, if you take an excessive amount of vacation, the company will extract the cost from your bonus, your potential raise, and your career advancement. In this way, employees and their managers can make personalized judgments about an appropriate amount of leave and how that should reflect on the total value delivered in a year.
In many companies, this policy is just a formalization of a practice which happens anyway: engineers can often take time off when they need to, modulo getting stuff done. Accounting wants to know how much time everyone takes off, because when you explicitly allocate a certain portion of compensation as vacation time, accrued vacation becomes a legal liability which must be paid upon termination. But if most folks take most of their vacation every year, and both managers and employees have no disputes about the amount of vacation, then this is just unnecessary overhead.
I've known employees that only take 1-2 weeks off, and others that take 5-6 weeks, with no negative impact on their careers. The important point is that strong contributors are often given more leeway than weak performers, for obvious reasons. Nobody will get fired for taking too much vacation, but if a manager perceives someone to not be pulling their weight and taking too much time off, they will try to manage that person onto a less desirable team, with an attendant loss of career promotion value (and often other compensation).
Despite claims of the existence of "10x programmers", I've never seen anyone take 45 weeks of vacation because they were that much better than everyone else. I would say 6-8 weeks would be pushing the boundaries of what most engineers could get away with, possibly at some risk to their career/compensation.