I expect there's some selection bias at play. If you're taking a philosophy major in college it's likely you already feel confident in your post-graduation career, so can study things that you like. Whereas if you're in a CS track it's because whether you get a job depends on getting a degree. The student studying philosophy is in school as an alternative to work. The STEM major is in school as a prerequisite to work.
Or Philosophy is usually a path to Law School on the professional path or a PhD on the research/academia path. In both cases, many/most of those 22-27 year olds are still in school and thus not counted as unemployed.
I don't know how true it still is with law being, to a fair degree, perhaps primarily a good career path for those who can land at white-shoe firms and federal court clerkships. But I've known a lot of people who drifted into law school from liberal arts and related because they just didn't have great job prospects. And quite a few didn't even end up practicing law.