The details are on
this page by Sheldon Brown.
Essentially, cogs are slightly narrower, and most significantly, spacers are narrower when going from 8 to 9 and to 10. This is possible because the 9 and 10-speed chains have a narrower outside with.
So yes, a 9-speed cassette will fit on the same freehub body (i.e. same wheel) than an 8-speed one.