Hungarian-American psychologist Mihaly Csikszentmihalyi is the author of the so-called flow theory in positive psychology. Designers of games and experience have utilised this theory to better understand users’ activity. The theory basically says that when you are dealing with something challenging which you nonetheless can handle, you enter a state of mind, a certain flow, where you are captivated, happy and eager, all at once.
The controlling factor in this state of mind is the equilibrium between challenge and ability. If the game is too easy, you start getting bored and need more challenge to get back in the flow. If the game is too difficult you can become anxious. To get back into the flow you need to improve your skills, become better.
Usually, games are tailored to a particular audience and so it can be tricky to keep different groups in the flow within the same game. The same is actually true for other experiences as well. Thus, it is important to remember the flow in all gamification.