Under the ground there is magma, magma is made from molten rocks which then rise towards the surface whilst cooling.
When the volcano erupts lava goes everywhere but some stays inside the volcano, this will later become diorite and the lava at the surface will becomes basalt
Some of the magma will cool enough to become solid, there rocks are called intrusive igneous rocks. If the magma gets to the surface then when it cools it becomes knows as intrusive igneous rocks.