Fun from games arises out of mastery. It arises out of comprehension. It is the act of solving puzzles that makes games fun. In other words, with games, learning is the drug.
Raph Koster (2013). “Theory of Fun for Game Design”, p.40, "O'Reilly Media, Inc."