on the back wheel of the bike is a cassette that consists of a bunch of rings with teeth. The 9 speed has 9 of them. The 10 speed has ten of them.

A compact double is a relatively new bike configuration.
Someone else will help you with the rest of your questions.