Soils are composed of minerals and organic matter and are classified based on their composition of clay, silt, sand, and loam. Soils form distinct horizontal layers called horizons, with the O horizon at the surface containing organic matter, followed by the A horizon of topsoil, then the B subsoil horizon, and the C horizon of weathered parent rock or bedrock. Rocks are composed of minerals and are classified as igneous, sedimentary, or metamorphic, with weathering breaking rocks down through mechanical and chemical processes to form soil in layers over the underlying parent material.