The theory of plate tectonics, which includes continental drift, forms a framework for the study of geology and the Earth.
The theory proposes that the Earth's crust is broken up into eight major and and about twenty smaller tectonic plates that move over the surface of the Earth. These tectonic plates are massive, irregularly shaped slabs of solid rock.
It is believed that hot rock rose up from the mantle and spread out on the surface of the Earth to form the ocean floor. As the ocean floor spread it pushed the continents around. Even today, the continents are moving one or two centimeters each year.
As the continents move around they sometimes hit each other, creating mountains. This is how the Alps and the Himalayas were created. Mountains like this are on the inside of continents.
Sometimes continents do not hit head on, but rub past each other. Since they do not have smooth edges, the rubbing is jerky and uneven. Pressure builds up and is then suddenly released. This creates earthquakes. The San Andreas fault in California is an example of this.
In some places the floor sinks back down into the mantle, usually at the edge of a continent. As it sinks it melts and hot rock rises up, creating volcanoes along the coast. The Andes are being created in this way. Sometimes the volcanoes lie in an arc just off the coast of a continent. The islands of Japan are being formed like this.