The smell emnates from a chemical buried in the soil called 'geosmin'(literally,earth smell).
This smell is given off by a bacteria.This bacteria(called Actinomycetus) grow in soil when conditions are damp and warm.When the soil dries out,the bacteria produces the geosmin spores in the soil as a survival strategy..When the rain hits the soil in a nearby place,it kicks up an aerosol of water and soil and spores into the air,where they are easier to smell(just like an air freshner).
We breathe in fine particles of soil containing the bacteria.


