Each HTTP response produced by a web site contains status code. Browser uses that code to interpret the meaning of the response. Basically there can be three different cases:
The request has been processed successfully by the server and the response body contains the requested resource (web page, image, etc.).
An error has occurred.
Server redirects the request to a new URL.
In the latter case the response contains a special “Location” header in which the new URL is provided. When browser receives such response, it automatically issues a new request using the specified URL. This way it can be redirected even to a different web site. The whole thing is done automatically, so the user does not see the process in the browser window. […]