Plants in veg still have small trichomes. They smell the most when stressed or hot, bumped into etc. Anything that ruptures trichome heads or brings the waxy coating to melting temps/raising vapor pressures on the contents inside.
The same thing cause flowering plants to stink, and if care is taken flowering plants dont stink either