Lava is amazing. Molten rock that erupts onto the surface at thousands of degrees! Our mainly solid planet (save for the liquid outer core, but that metal, not lava) can melt but all that molten material isn't the same. Those differences in composition are what drives the different behavior of lava on the surface.
There is a (mostly) simple relationship between lava composition and behavior. The more silica (SiO2) in the lava, the "stickier" it is. This increase in viscosity means that lava goes from free-flowing to barely-flowing. Different volcanoes will erupt different compositions of lava depending on how the rock melts at the volcano and how it changes as it makes its way to the surface.
The composition isn't the only factor that changes the lava's stickiness. The hotter the lava, the runnier it is. More crystals in the lava? Stickier. More water dissolved in the lava? Runnier. More bubbles forming? Stickier. The final viscosity of the lava is a complicated combination of all these factors, but composition really drives the bus.