Apophenia is the perception of meaningful connections between unrelated things. The term was coined by psychiatrist Klaus Conrad in his 1958 publication on the beginning stages of schizophrenia.
Pareidolia is a type of apophenia involving the perception of images or sounds in random things. An example is the perception of a face within an inanimate object— the headlights and grille of an automobile may appear to be "grinning" or seeing the face of a religious figure in a piece of toast or in the grain of a piece of wood. Pareidolia occurs when our brains mistakenly interpret an object, shape or configuration with some kind of perceived "face-like" features as being a face.
Gambler's fallacy is a type of apophenia where gamblers may imagine that they see patterns in the numbers that appear in lotteries, card games, or roulette wheels.
There is no scientific reason why apophenia occurs although there are a number of theories.