Just by looking at the Earth, it would appear that the surface was smooth and made of one piece. The opposite is true though — the surface (outermost layer of crust and the upper mantle) is made up of many large, flat pieces of rock called tectonic plates.
The tectonic plates are heated and cooled by the rocks underneath it. As a result, the plates move apart, collide, or slide under each other at a rate anywhere between 2 to 12 cm per year. If the accumulated stress exceeds the strength of the plates, the rocks crunch or break suddenly, resulting in features such as mountains, volcanoes, mid-ocean ridges, oceanic trenches, and, of course, earthquakes.