A user agent is a description sent by the visitor’s browser or more generally client. It provides information of the kind of software used, such as browser type, browser version, operating system, and relevant extensions and tools, etc.
That makes it possible that the site can deliver optimized versions for the requesting client. These are for example special formatting or scripts, which take into account the differences of browsers.
In the beginning of the Web, it was dominated by a few browsers, most notably the Netscape browsers who identified themselves as Mozilla.
> Mozilla/3 (...)
One of the first who used this name was Internet Explorer with the aim of gaining access to sites, which only allowed Mozilla browser. He introduced „compatible“.
> Mozilla/4 (compatible, MSIE6.0 ...)
says that it is a browser compatible with Mozilla 4th version. Its own ID is found later, MSIE 6.0, Internet Explorer 6
This form of identification is very flexible and still the standard. It allows you to express any compatibility and identify any tools and extensions, including the version. An integral part is also the indication of the operating system. It makes sense, since there can be significant differences in the presentation.
Most users keep the own agent identification unchanged, although it is possible to change and often directly supported by browsers.
As webmasters you can read out the agent to provide a special version for each browser. Now break this agent up into browser, operating system and extensions – this is possible on the server – and then deliver the most appropriate format or scripts possible.
Nowadays with the many clients possible, and old idea is stronger supported than ever: „best viewed in any browser“ was a reaction to excessive browser optimization. To achieve a „best representation in every browser“ you follow web standards. Of course not every browser handles them correctly, but there is competition in the market and browser that outperform others and are gain market share for that reason (beside others, though).
Of course several incompatabilities might have critical consequences and still force web masters to supply specialized versions.
See the agent of your browser.