Remember, by the time this was written, it was surely tradition that had been passed on for generations. Thus the writer probably didn't make it up.
My theory: Note that there are two creation stories. My guess is that when Genesis was written, there were two traditions, perhaps from different parts of the country. The author might have seen his goal as preserving the traditions involved in Israel's understanding of itself and its relationship to God. Hence he wrote down both of them, rather than trying to merge them into a single consistent account. In later stories (e.g. Noah) you'll also see evidence that the author was working with more than one source.
I'm not an OT expert. There's lots of information in Genesis that scholars look at. Examples: lifetimes slowly decrease, reflecting the distance from creation. Geneologies in the OT often have names that are either names of tribes or nations or of key figures in them. Scholars look carefully to see how Israel regarded those people.
But there's no reason to think that these accounts are completely historical, or that God is in any sense the author. I understand that that idea is important to you, but there's no reason to think it's true. I've seen no arguments for it other than indignation when someone challenges it. The historical background of the patriarchal stories does often seem to have historical elements, so there may well be historical memory in them. Thus it's quite possible that Abraham and Moses existed. But there is zero chance that Genesis and Exodus are completely or even mostly historical.
It's not as if Israel was the only society with traditional stories about origins. As far as I know, most cultures had them. So it doesn't require any special explanation why Israel would.