Facebook is basically a slot machine. Checking your notifications, almost always it's garbage but one day it could be an old friend reaching out to you. It's designed to be addictive and it's very successful.
If you want to learn more about it, the effect is usually called "intermittent reinforcement". Check out the first two episodes of https://humanetech.com/podcast/ (transcripts available)