It's a complex ecosystem that depends on a balance of water, air, organic mater and minerals. Minerals are those tiny pieces of rock that most of us think of as dirt. To hear most gardeners talk, the only size particle found on earth is clay. Clay is not all bad. It holds nutrients and water very well.
Sand helps with drainage because the particles are so large.
Good garden soil has a balance of these different particles. If you have too much of one type, adding organic matter will usually help. There is also air in your soil. The air is found in pockets between the minerals and organic matter. If you don't have enough air, your roots will not be healthy.