You have to understand that there are varying perspectives about this. There are "New Earth" versus "Old Earth" creationist perspectives. And, I suspect not even everyone here would all be on the same page with that. God was under no obligation to explain the finer details and give an exhaustive, comprehensive explanation of how He did it or everything that is "out there" in our modern, scientific 21st Century terms to people who lived thousands of years ago in Ancient Near-Eastern cultures. He revealed to them (and to us) only what they needed to know, apparently.
My position is- I do not really "know" how old the earth is. I know what modern science suggests about it. And, I also know the language and style of describing creation in the Hebrew scriptures. What's more- it doesn't really matter to me one way or the other how old the earth is. If God created everything more recently but somehow "snapshotted" it with a primordial history that science picks up on- fine. If the universe is in reality as old as what scientific theories propose, but God expressed it in terms the ancient Hebrews could understand without explaining every nuance in our modern Western scientific terminology, also fine. I recently read a book entitled, The Lost World of Genesis One, by John Walton. Interesting read on that topic.