Ladybugs have spots to confuse predators, and to trick them into thinking they may be poisonous. They also confuse the predator as to where they eyes are.
Some entomologists think the ladybug has spots is to ward off the predator. Yellow, red, and black are colors that let predators know the bug may be harmful. Ladybugs emit a nasty odor and are bitter in taste.