The physiology of fun?

Ferrets and styrofoam peanuts.

Some animal species play when young and pretty drop it as adults. Some continue well past maturity. I assume there’s a physical basis, but I have no idea what it might be. Thoughts?