Igneous rocks came first
When the Earth first formed, about four and a half billion years ago, it was all liquid rock and liquid metal because it was so hot. But when the Earth cooled down, around four billion years ago the igneous rocks formed. That was granite and quartz and lava and other kinds of rock.
Wind and rain eroded them
What are sand and clay made of?
Little by little, these eroded bits of rock rolled or blew down from the mountain tops to the river valleys. Then the rivers carried the bits of rock along the river valleys to the ocean. The little rocks mixed together to make sand and clay. Or they made mixtures of sand and clay. A lot of the sand and clay ended up on riverbanks and on beaches, where you see it today.
Sedimentary rocks formed
Some of the sand and clay fell into lakes and oceans. Gravity pressed the water down on top of the sand and clay and mashed the particles together into new rocks. These are sedimentary rocks like sandstone (made out of sand) and shale (made out of clay).
Plants die and make dirt
Beginning about a billion years ago, there were plants on land. When these plants died, the dead plants mixed with the sand and clay to make dirt. Like the sand and clay, dirt tended to fall or blow down from the tops of hills into river valleys. Then the rivers carried the dirt along the river valleys to the oceans.
River valleys have a lot of dirt
That’s why when people came along about 150,000 years ago, they found the best land for hunting and gathering, and later for farming, was in river valleys, especially near the ocean. The early cultures of the Egyptians in the Nile valley, or the Sumerians in the valleys of the Tigris and Euphrates rivers are examples.
So are the Chinese along the Yellow River, the Norte Chico in Peru, or the Bantu along the Niger river. The Woodland culture along the Mississippi River and the Harappans along the Indus river also settled in river valleys where there was plenty of good dirt (and also you could use boats on the rivers, and catch fish).
Who first figured out how erosion worked?
The Greek scientist Aristotle wrote about erosion in the 300s BC. More than a thousand years later, about 1000 AD, the Islamic scientist Ibn Sina wrote about igneous and sedimentary rocks, and how mountains erode away into nothing.