The surface of the Earth is made of masses of solid plates called tectonic plates. These plates are ' floating' over a semi-molten layer of magma which in turn lies over the molten core which is made largely of iron. The tectonic plates move towards or away from each other at different rates - ranging from a few centimetres to several metres a year. As one plate moves towards another, the weaker one is forced downwards and as the plates pull away from each other at different places rift valleys are created - like the Great Rift Valley in Africa.
The plates vary in thickness according to the different geological make-up of the rock. When two plates collide the trauma causes holes to appear in the crust - resulting in volcanoes as molten magma bursts to the surface under tremendous pressure.
These events occur largely where two tectonic plates collide at a speed greater than the pressure can deal with - such as the Pacific 'ring of fire'.
The movement of the plates results in pressure building up and at some point, this has to give- resulting in an earthquake. Earthquakes can occur wherever the plates collide or are travelling away from each other and are simply the plates giving way or settling. Because the mass of rock is so vast, the resulting earthquake is felt across many miles - sometimes just a small quake and sometimes a massive quake such as Japan has recently suffered.
Volcanoes are not always connected to immediate earthquakes but very often, because the earth's crust has been comprimised, this results in a mass of magma gushing under force from beneath the Earth's crust - a volcano.
Some volcanoes resulting due to tectonic plates colliding result in a peak where the rock is pushed upwards, with the top 'blowing off'. Others result from the Earth's crust sinking as plates are pushed away from each other - these kinds of volcanoes are wide and less violent but tend to be longer lasting.
So, an earthquake may result in a volcanic eruption but more often than not, the magma beneath the Earth's crust is not able to reach the surface.
In other areas of the world where the Earth;s crust is thin, there is a constant venting of thermal activity - Yellowstone National Park and Iceland are such areas but the slow venting is not a sign that there will not be massive eruptions. In all these areas, below the surface lies a huge pool of molten rock which,given even small movements or the surface crust will result in volcanoes