Volcanic eruptions occur when molten rock accumulated underground comes out to the surface due to pressure. As the material comes near the surface, it causes a violent eruption, almost like an explosion.