Before the eruption,the fluid pressure from the rising magma (dense liquid) cracks the rocks, the tectonic plates under the Earth's crust are moved and as a result, earthquakes are caused. A lot of small earthquakes in the area near a volcano hint what may happen.