If a company is looking for "bums on seats" then there is no advantage. Let's ignore that case.
When a company hires an employee, that employee will do work for the employer, and the employer will supply salary and possibly other benefits to the employee. The higher the salary and other benefits are, the better the chances to find an employee, and to find a better employee, and to keep them.
Flexible time costs the employer no or little money, but can be a huge benefit to the employee. And that's the kind of thing a company should be looking for: Giving the employee benefits other than salary, if they cost less than salary.
Some other answer talks about "ridiculous extras like food". If you have the space, providing free or cheap food to employees is extremely beneficial to the company. Every place in my experience where this happened, people counted it like salary (so it really gets you better talent and keeps that talent), while costing the company a lot less. And importantly, lunch breaks were shorter, people ate healthy which is good for the company, and people were often discussing work problems during lunch.