The short answer is, the browser doesn't.
Most web servers can transparently
gzip the data being sent to your browser to save on transmission time, but
gzip is just a compression algorithm.
tar, on the other hand, is a format used for batching files together into a single archive.
The longer answer is that it's the interplay between two different HTTP headers:
When you hit a webpage that uses
gzip, you're receiving a
text/html with a
gzip. The browser knows how to handle
text/html, and so it transparently uncompresses the response and renders it on your screen.
When you download a
.gz or a
tar file, you're receiving something with a
x-tar-gz), which prompts the browser to treat the data as a file download, rather than trying to do anything with it on its own.
There's no such thing as a
tar, since that header is only ever used to advertise a type of compression - so sending a
.tar.gz file to a browser with
gzip encoding would be pointless and wasteful. The data is already compressed.