Your user agent string is a line of text containing information about your Operating System, Browser and software in general. Websites, for example, use this to extract what browser and what version you're using, so that they can adjust specific things based on it. Different browsers behave differently. Also, for example, Android can behave differently from iOS.
When you visit a website with your browser an HTTP request will be made to the server of the website. Inside this request is your User Agent string. An example:
It uses a variable provided in the PHP programming language. For each user, you can view the variable $_SERVER, which provides even more information about the visitor. For this page we're using $_SERVER['HTTP_USER_AGENT'].