That many animals with a certain minimal amount of intelligence play, is a fact. We are no different in this respect (it would be interesting to know if a social structure or the level of intelligence determines the amount of play). Evolutionary biologists propose that play must be important, as the risk of injury during physical play is significant. So why would beings play at all?
Research from psychology supports that play (at least in humans) is beneficial to cognitive, motor and emotional development. Modern findings in neuroscience suggest that play promotes adaptivity and multiple ways to achieve a desired result, improvisation. It should be noted that learning through play is great for learning procedural knowledge, mostly non explicit knowledge on (social) behaviours and rules in different contexts. It's not been established that play promotes declarative knowledge (formal knowledge of facts) more than other activities. That play is great for procedural knowledge seems strangely obvious, considering that a lot of play is rule governed, and games are at least partly constructs of rules.
Wikipedia mentions that Marc Bekoff (a University of Colorado evolutionary biologist) who proposes a "flexibility" hypothesis that attempts to incorporate these findings. It argues that play helps learn to switch and improvise all behaviors more effectively, to be prepared for the unexpected. "Play may teach beings to avoid "false endpoints"". In other words, beings that play will harness the tendency to keep playing with something that works "well enough", eventually allowing them to come up with something that might work better, if only in some situations. This also allows beings to build up various skills that could come in handy in entirely novel situations and actually wield their intelligence as a benefit." Another advantage is that play allows beings to practice concepts that are not formally taught like how to manage misinformation and deceit, supported by findings that play promotes procedural knowledge.
|Source: Chefkeem on Pixabay|
This is all well but it doesn't answer the question, why a being would engage in play in the first place and enjoy it? Why would dealing with challenge be enjoyable? To answer this question, I'll step out of the play focused box. These days learning is not experienced as fun by many humans, because of institutionalized presumptions such as that it should be serious. Still, play has a lot of positive learning effects and is displayed more by younger beings. This correlates with the fact that only beings with a certain minimal amount of intelligence engage in play and that play has many developmental benefits. There fore I hypothesise that play is originally a behaviour that promotes learning and learning starts out as fun.
Even human children start out with a liking for learning. A great audio takeaway sheds some light on the joy of learning. In the takeaway John Gabrieli (neuroscientist at MIT) gives a short interview. He starts out that the brain has a robust reward mechanism in the brain for the activity of learning, based in the lower part of the basal ganglia. It produces dopamine if a being is put in a state of anticipation and engagement (games are well known to do both). This dopamine reinforces learning and delivers a feeling of joy.A girl looks at her feet, she's only three years old. She's playing tag, together with some cousins and her older brother. While she's running away from her one year older cousin her face shows utter concentration. If she trips, she's "it". Not only does she have to fine-tune her motoric movements beyond regular walking, she also has to switch her attention continuously to avoid the branches, tree trunks and the precious roses of her aunt. This stimulates her brain in many ways, the challenge that arises from a difference in what she can and can't yet quite fully do makes the activity even more stimulating. An intrinsic drive to run faster, be smarter and not be "it". The garden borders a forest, and in the distance she can see young deer doing almost the same as she and her family members are doing. They are playfully running after each other. On their drive home her dad suddenly clunks the horn, the deer jump aside to live another day. What greater evolutionary benefit than to make the acquisition of key survival skills fun through play?
To say that play is only fun because of dopamine while learning in an engaged state, would be too short-sighted. This is just an attempt to put play in a cross-species developmental perspective, though the findings of different areas of science seem to match like a puzzle. It's probably the language barrier, but on first sight the research on animals playing seems to be short at hand. Maybe worth a look on another day...