Foot odor is caused by bacteria that live on your feet. They actually feed off the sweat and dead skin cells we all have on our feet (some of us more than others). The bacteria expel a rotten-egg smelling gas. This gas is what you (and others) smell when you take off your shoes.
With mild foot odor, bacteria generally live on the top of your skin and can easily be treated with many good over-the-counter products found at your local pharmacy. With chronic foot odor (the kind that just won't go away), the bacteria may have penetrated a little deeper into the skin. They like to hide inside and underneath dead, calloused skin, making it difficult for most products to reach.