Convection currents in the mantle are driven by the heat from the Earth's core and the upper mantle. When magma is heated, it undergoes changes in density: heated magma becomes less dense than the surrounding cooler magma. This decreased density causes the hot magma to rise towards the Earth's crust.
As the hot magma rises, it displaces the cooler, denser magma, which then sinks back down toward the core. This cycle of heating, rising, cooling, and sinking creates convection currents. Over time, these currents contribute to the movement of tectonic plates on the Earth's surface.
In summary, when magma is heated, it rises due to decreased density, and the cooler, denser magma sinks, creating a continuous flow that drives the convection currents within the mantle.