The best explanation I have seen for dreams, to put it very simply, is its just our imagination running wild. Our brains arent focusing on any real thought, so they just go to imagining things.