Even if you don't consider yourself superstitious, you probably do a few things that count as such: you may avoid opening umbrellas indoors, or knock on wood when you say something good that you don't want to turn bad. According to the University of Iowa, superstitious behavior happens when an independent action (for example, opening an umbrella indoors) happens close in time with a reinforcement or punishment (a vase falling off a table across the room, perhaps). Because they happen around the same time, your brain associates the two, coming to the conclusion that one caused the other.
B.F. Skinner was a behaviorist who was fascinated with stuff like this—specifically, how people's actions arise from elements in their environment. He was, as Smithsonian puts it, "a controversial figure in a field that tends to attract controversial figures. In a realm of science that has given us Sigmund Freud, Carl Jung and Jean Piaget, Skinner stands out by sheer quirkiness." (If you don't believe it, we have three words for you: pigeon-guided missiles.) Most of his strange experiments centered on what's known as a "Skinner box": a sensory-deprivation vessel that limited an animal to one stimulus at a time. In one experiment, he demonstrated positive reinforcement by placing a rat in a Skinner box with a lever that produced a food pellet. The rat would first knock the lever accidentally, but soon learned to make a beeline for the lever the moment it was placed in the box. The same went for negative reinforcement: if the lever turned off an unpleasant electric current, the rat quickly learned to go straight for the lever to relieve its discomfort. But what would an animal do if there was no lever at all?