for those who don't want to watch his whole boring video here's the short of it:
if you know the volume of the jar you can accurately estimate with this formula
(volume in mils / .715) x .665
so his 1150mil jar could hold 1608 M&M's (which have a known volume of 0.715 mils) if there was no space between the M&M's. But there is space. Luckily the randomness of that space averages out to be about 66.5%. So 1608 * 0.665 = 1069. He hand-counted them and said there were 1072. So the formula works, in this case it was only off by 3 M&Ms.