Plants secrete oils in dry periods, which accumulate in rock & soil. Rain then causes smaller, volatile compound within them, likely created by oxidation of fats, to be released. The term 'petrichor' was coined in 1964 to refer to this smell. Scientists think the purpose of these compound is to prohibit growth during dry periods, and limit competition for water.