That's because Vim is using
$VIMRUNTIME/defaults.vim as the vimrc file.
If you look at
:h .vimrc you'll see that Vim looks in five places for a vimrc file, stopping once it's found one.
When you have an empty personal vimrc (in your home directory, usually) then Vim will read that and stop searching. Obviously, if the file is empty there's no configuration of file type detection and, thus, no syntax highlighting.
When you don't have a personal vimrc then Vim continues down the list until it gets to the last item which is defaults.vim. This vimrc file includes
filetype on and
syntax on which enable file type detection and syntax highlighting, respectively.
Note that to truly work without a vimrc you'd need to use the
-u NONE flag when you run Vim.