Imagination gives us an ability of seeing ourselves from the outside to realize how we come across to us. If this kind of amazing recursive perception is (possibly) unique to human being, that might be a critical point in evolution of humanoid. Imagine what was it to imagine yourself for the very first time! Now we could imagine ourselves in the past (remember) and then use the past-to present extrapolation to imagine ourselves in the future – first 2st-person (point of view) dreams.
To do that we had to get at the beginning some important abilities – to have first conscious predictions and ability to imagine alternative reality.
When we dream and extrapolate our imaginary future based on memories, our minds build the time-independent (or salable) sampled (in neural system) structure for subset of subjective realities. Essentially from this point we could build new alternative realities. At the very beginning it was only extrapolation of existing reality (to predict and get evolutional competitive advantage), but then the extended deviation in prediction caused outliers – imagination of something totally not related to reality. What was that first time? Maybe two-headed dangerous predator was giving a birth to a fear of imaginary? Maybe the will of getting a mate produced an image of some beautiful creature – first dreams of love ?
These days, the animals “actively recall themselves” and not just respond to a recorded past (“state machine”) as we know it happens in dreams, when they imagine themselves running, they are moving legs.
And so it begins – the path to a self.