tar(1) autodetects the compression format.  It also handles zip files
just fine (as well as  tar, pax, cpio, zip, jar, ar, xar, rpm and ISO
9660 cdrom images and can create tar, pax, cpio, ar, zip, and shar
archives).