Superstitious behavior occurs in animals too. They are fooled by randomness and believe a correlated action caused an event.

One classic experiment was B. F. Skinner’s Superstition in the Pigeon.

Skinner put some half starved pigeons in a cage and fed them at regular intervals. The pigeons believed certain actions caused foods and began repeating these actions over and over.

This is no different than the gambler fallacies where humans swear they see a lucky trend, or believe that lucky charms improve probability.

From Skinner’s experiment:

If a clock is now arranged to present the food hopper at regular intervals with no reference whatsoever to the bird’s behavior, operant conditioning usually takes place. In six out of eight cases the resulting responses were so clearly defined that two observers could agree perfectly in counting instances. One bird was conditioned to turn counter-clockwise about the cage, making two or three turns between reinforcements. Another repeatedly thrust its head into one of the upper corners of the cage. A third developed a ‘tossing’ response, as if placing its head beneath an invisible bar and lifting it repeatedly. [And so on…]

The conditioning process is usually obvious. The bird happens to be executing some response as the hopper appears; as a result it tends to repeat this response. If the interval before the next presentation is not so great that extinction takes place, a second ‘contingency’ is probable. This strengthens the response still further and subsequent reinforcement becomes more probable.

Our whole concept of luck is no different to pigeons spinning in their cage.