The viscosity of magma is determined by its silica content. Basalt magma, on the one hand, which is often of low viscosity, has a low silica content of approximately 50% or less. Rhyolite magma, on the other hand, has high viscosity due to the high silica content of approximately 70% and more.
Gas content and temperatures of the magma are the other factors that determine an explosive or nonexplosive eruption. High temperatures and high gas content (coupled with high viscosity) cause violent explosions.