Animals that prey upon snakes include birds and mammals like coyotes and wild boars. Mongooses are a natural enemy of snakes and are common household pets in countries like India where poisonous snakes exist in large numbers.
Eagles and other predatory birds have the advantage of being able to spot the snakes from high up in the air and swoop down and surprise the snake with an attack. Young snakes are particularly vulnerable to birds as they can be attacked in trees, on the ground, and in the water. Wild boars, raccoons, and foxes also eat snakes, although they make it a point to avoid venomous snakes. Raccoons can reach snakes in trees as well.
In order to protect themselves from predators, some snakes use camouflage to blend into their surroundings. Other snakes have the ability to burrow into the dirt or hide under leaves. Venomous snakes often have distinctive coloring that signals they are dangerous. Rattlesnakes use their rattles to warn predators not to attack, while cobras have the ability to expand their hood and hiss, making them appear larger. The Scarlet Kingsnake uses its color pattern to mimic the dangerous coral snake, causing many animals to avoid attacking it.