its an example of mimicry. since coral snake is poisonous, potential predators stay away if they recognize its pattern. The king snake is not poisonous, but by imitating the appearance of a species that IS poisonous, the king snake may reap the benefits of a preventative defense it doesnt actually possess