Sand is primarily composed of silica (silicon dioxide), which is the main ingredient in glass. When sand is heated to extremely high temperatures, it melts and forms a viscous liquid. This liquid can then be cooled and shaped to create various forms of glass.