The headers of a request are passed between the client and the server to help the server generate a response that is in the context of the user.
The headers can be grouped in 2 categories: the first one drives the communication between the client and the server and the second one parameterize the content returned to the user. For the communication headers, we have Accept-Encoding defining if the response client support compression. Accept that defines the type of response the client expects, it can be json or text javascript for example. For the headers handling the response, we have Accept-Language that defined the language in which the user expects the response from the server. The user-agent is passed to help the server optimize the reponse depending on the client receiving the response.
https://en.wikipedia.org/wiki/Internet_Protocol