I think it's a balancing act with plenty of gray area. Personally, I almost always side with employees in cases like this, because it's ridiculous to me that a company could claim ownership of things that its employees create which are unrelated to their jobs, or which they produced with their own time and resources.
But I also think that there are some people who are exceptional cases. The real high earners in a company, especially if they're technical staff, are probably real luminaries in their field, and the company is paying them a significant premium in both money and autonomy because they believe that such an employee will produce a lot of valuable new ideas for the company.
So if your rock star programming wizard quits to start a new company, taking a project that they've been iterating on during work hours on their company computer for the past 6 months while they were drawing a paycheck...well, if you look at it from the company's point of view, you can understand why they would feel like they got robbed blind.