Some snakes, such as rattlesnakes, have rattles on their tails as a warning signal to potential predators. When the snake feels threatened, it will shake its tail rapidly, causing the segments of the rattle to strike against each other, creating a buzzing sound. This acts as a warning to predators to stay away, as the snake is ready to defend itself if necessary.