It's actually fairly complicated in detail but the basic framework is well understood.
I'll assume everyone reading this knows that the surface of the Earth is broken up into a number of rigid plates. These tectonic plates are all moving, due to deep convection currents in the Earth's mantle. The boundary between plates is where all the action occurs.
The Earth's major tectonic plates
Italy is on the boundary between two of these tectonic plates - the African and the Eurasian. When two plate boundaries collide, and one has oceanic crust (the Mediterranean seafloor), which is thinner and more dense than continental crust, this oceanic crust subducts down into the mantle and begins to melt. This melting provides magma which then rises up to the surface to feed volcanic activity. Below is a simple diagram illustrating this process.
This is basically what's going on beneath Italy. The actual boundary between the African and Eurasian plates, however, is actually fairly complex in the Mediterranean Region. Here's a map indicating the location of some Italian volcanoes along with a barbed line indicating the plate boundaries here.
Here's a cross-section from A-B in the map above. As you can see, the floor of the Adriatic Sea is African plate and it's subducting beneath Italy. This subduction generates magma which feeds volcanoes in an arc from Sicily up to Vesuvius (in detail, this is far more complex - a slab has actually detached from the subducting plate creating a window which makes the geochemistry of the magma erupting from Vesuvius a bit different from other Italian volcanoes).
While the Vesuvius region has been volcanic for at least half a million year, the mountain of Vesuvius began forming around 25,000 years ago. A long history of violent eruptions is documented by radiometric dating of pyroclastic deposits (deposits of ash formed by explosive activity). One of the more recent eruptions was in 217 BC. The mountain was then quiet for over 200 years and people forgot the dangers. The population around the mountain increased, vineyards were planted in the rich volcanic soil, and it all came to an end in the eruption of AD 79.
Vesuvius has erupted dozens of times since AD 79 as well. The last major eruption was March 18, 1944. Today, hundreds of thousands of people live in the most-dangerous areas around Vesuvius while millions live close enough to be dramatically affected by its next eruption.
And there will be another eruption.