The Earth has four main layers - the inner core, the outer core, the mantle and the crust.
Heat from the core causes convection currents in the mantle. These currents slowly move the crust around. In some places the crust is destroyed. In other places new crust is formed.
Earthquakes and volcanoes are primarily found at plate boundaries. The plates are like giant rafts that slowly move around. Their movement is driven by convection currents in the mantle. The mantle is much hotter than the crust and its rock is molten. At the boundaries between plates, molten magma is able to force its way to the surface and escape as lava.