Here's a mnemonic that could save your life one day: "Red on yellow will kill a fellow; red on black is a friend of Jack."
Coral snakes (like the one on the left of the photo) are not aggressive but possess extremely potent venom. Milk snakes, a kind of king snake, are harmless but benefit from similar coloring to their dangerous cousins. When a nonthreatening species evolves to look like a harmful one, the phenomenon is called Batesian mimicry, named for the 19th-century English naturalist H.W. Bates.