These four pieces of wood, usually carved from ebony, are used to hold the strings in the pegbox of the violin. They're shaped so that they're easy (ish!) to turn.
We use the pegs to tune the violin by turning them to tighten the string – which raises the pitch - or to loosen the string – which lowers the pitch.
Turning the peg even just a small amount will make quite a bit of change to the pitch of the string! So we need to be careful not to turn the pegs too far above the desired pitches of G, D, A, & E!
Otherwise, there'll be too much tension in the string, and it will snap!