If you add a for auto, it will choose the right compression based on the file name.
tar -caf foo.tar.xz foo
Will be an xz compressed tarball.