Day to day goal orientation could easily be a trait that was selected by evolution over the eons. Goals don’t imply consciousness and intentionality, just an end point for behavior to converge. Having a goal simply provides an evolutionary advantage that can proceed from natural selection. What remains hard to explain is consciousness. It is possible that when a system becomes more complex, it might key into some entirely new physics; for example, a “consciousness field.” The challenge is to find a test to determine whether an entity is conscious. Then a "phase transition" from unaware to aware might be observed as one moves to relatively more complex systems--whether computers or living creatures.
Joseph Bisognano