Why does User Agent lie about what browser I’m using?
Recently I went through Gary Bernhardt’s wonderful http-server-from-scratch video (sorry you need a subscription to watch, but they are well worth it).
In it you start your http server on port 9000 and can print out received connections. I went in Chrome and went to http://localhost:9000 and got

"User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36"
Now I was in Chrome so what the hell was Mozilla, AppleWebKit, KHTML, Gecko or Safari doing in my User Agent line.
I did a bit of digging and found this excellent telling of the tale written back in 2008
Its well worth a read but if you don’t have time here’s the jist.
In the beginning different browsers had different capabilities so servers would check what browser the request was coming from (“user agent sniffing”) and give them different versions of the website based on what browser they used.
Browser A had fancy feature X so when it hit the server it would get shiny page with all the stuff for fancy feature X.
Browser B wouldn’t have that feature so would get sad old page with no fancy feature X stuff.
However Browser B would then implement feature X, but because nobody had updated their server setup they still wouldn’t get the fancy feature X even though they now had the power to be shiny!
Understandably Browser B got pissed off and so now just pretended to be Browser A when it hit the server. It would sneak the feature from the browser.
This continued over and over and over with more browsers and more features until we get to the point now where every browser pretends to be every other browser and as the article nicely finishes
….and the user agent string was a complete mess, and near useless, and everyone pretended to be everyone else, and confusion abounded.