In a magma melt, molecules are polymerized. This means they cluster and form larger complexes by repeated linking of the same molecular groups. The silicon and oxygen atoms in magma are bonded strongly together molecularly. The more bonds there are, the more viscous the magma is. Therefore, the more silica there is in a magma, the more viscous it is.
Temperature is also related to viscosity.
The hotter a substance is, the less viscous it is, just like those big vats of syrup in dorm cafeterias. Viscosity is important because it determines the type of eruption that will occur, and thus what shape or type of volcano will be formed by the eruptions. Gases are easily released from low viscosity substances. In more viscous magmas, gases are not released easily, and build up. When the pressure builds, a violent eruption can occur.