I'm guessing that today, in the current age of the modern web, user agents strings are no longer so relevant, and can be basically set to anything?
One can argue that yes, in 2018, there should be APIs that allow to detect all this stuff in a much better way than parsing random mess of legacy markers that is a common user agent. But in reality, parsing UA string is still the case and unfortunately keeps being the case, including very major and technically advanced sites.
(Summary: feature detection requires more round trips, and slows down pages.)