Microorganisms in the soil facilitate the decomposition of plants, bug bodies, and other living things in a process called humification. Humification occurs in the soil and in compost piles. Along with microorganisms, worms, nematodes, and other tiny critters help this transformation along. The black, rich, earthy smell from premium soil is the humus. (The black color is from carbon.)
When you add organic matter to the garden or compost pile, you are feeding the organisms that make nutrients available to your plants.
I hope this information inspires you to grow more of your own food. You can ask your garden questions on my Home page.