The world will just generate with air blocks replacing non-vanilla blocks, and your non-vanilla items will just disappear. Re-installing the mod will not bring the blocks or items back, unless you do so before loading the world again.
(As a side note, some mods used to render your world unplayable unless the mod was installed again, I'm pretty sure Notch fixed it though, but there might be a few that mess things up.)
The mod will make new item IDs, and items are stored by the item IDs. So, for example, I once had the portal gun and I updated the mod and I had a melon stem in one of my chests :). Any other items or blocks are just not there!
When I started to use a different minecraft version, it actually turned the blocks into what I guess must have been the closest texture. I think that the game gets confused and thinks that you're looking for (block thats texture Is most similar) and turns it into that. For example I used a type of glossy stone block, and when I changed versions, it turned into stone. The slime block turned into, well, a block from mo creatures of all things lol.
This is maybe what happens in later and more developed versions.