Violins make sound by dragging the bow (stretched horse hair) over a string, causing the string to vibrate. At the micro level, the bow pulls the string to one side using friction, until the tension on the string pulls it back - this happens hundreds of times per second, and forms the basis of the sound we hear.
Horse hair is slippery by default. To create the necessary tension violinists apply a small amount of solidified tree resin by wiping a piece along the length of the bow. This piece of hardened resin has the same approximate texture as glass or hard candy, and is called rosin.