The interlocking sound-making structure at a rattlesnake’s tail is called a rattle.
A rattle consists of hollow segments made from keratin, the same tough protein found in human fingernails. Each time a rattlesnake sheds its skin, a new segment is added at the base. When the tail vibrates rapidly, the loose segments strike one another and produce the familiar buzzing warning sound.
The rattle is primarily an anti-predator signal. It can warn large animals, including people, that the snake feels threatened and should not be approached. Rattlesnakes do not need to bite every intruder; the warning may help them avoid a costly confrontation.
The number of segments does not reliably reveal a snake’s age. Segments can break off, and shedding rates vary with growth and conditions. The sound is also not produced by a hollow button filled with beads: the segments themselves create the noise.