Naturally forming soils are created under a huge range of conditions, and the study of soils constitutes its own science, "soil science", that overlaps with geology, hydrology, and ecology.
Soils are primarily derived from rock ('lithic') fragments of various sizes. These may be derived from the local bedrock, or they may have been transported some distance by the action of water (e.g. river silt), wind (aeolian sediments such as loess), ice (e.g. boulder clays), or humans. Climate and biological factors can break lithic fragments down into other minerals - e.g. clay minerals, and dissolved salts.
In horticulture and ecology, the lithic components are usually classified according to their size: clay (<2micron), silt (2-60micron), and sand (60micron-2mm). In turn, soils are then classified according to their relative proportions. For example, "clay soil" typically has 50% or more clay particles, whilst "medium loam" has 5-25% clay, 20-50% silt, and 30-60% sand.
Soils also contain organic material in the forum of living organisms (e.g. bacteria and arthropods), and humus (partially decomposed dead organic material). Humus is important for horticulture and agriculture as it helps to absorb water and acts as a reserve for nitrogen, phosphorus, and other plant nutrients.
For horticultural purposes, plants prefer soils with specific drainage, nutrient, and pH characteristics. Adding sand can improve drainage. Adding humus and/or mineral salts can affect the nutrient and pH characteristics.
Use this tag for all questions about soil - especially diagnosing soil problems, and improving soils.