I think from long alcohol & brownie fueled student discussions with biology post grads..........
during the night you brain transfers your short term to your long term memory & visa versa. Dreaming is a biproduct of that, it's a bit like watching a badly edited version of your recent experiences, thoughts and so on. This is why I've probably been dreaming about getting washed away in bunny pee for the last week. Therefore any animal that sleeps could have some sort of dream.
However, don't take this at 100% accurate, the alcohol may have fried some of my transfer to long term memory.
My buns don't properly sleep much unless it's sunny...then they sunbathe with their eyes closed & head down.