I use HandBrake. I didn't realise VLC could do this too. Nice one, I may have to try it to see if the resulting size is even smaller.
I believe it achieves the smaller size with minimal loss in quality because it finds the pixels that don't change and replaces them with a function instead of displaying each pixel. In a very simple way say your video is s something like
11111111111111111111 (so that's 20 1's in 20 boxes)
It's changed to something like
1 x 20 (so that's 2 boxes instead of 20 )
The more whitespace your video has, the more it will compress nicely.