Read Genesis 1:7 Using Other Translations
And God made the firmament, and divided the waters which were under the firmament from the waters which were above the firmament: and it was so.
And God made the expanse and separated the waters that were under the expanse from the waters that were above the expanse. And it was so.
And that is what happened. God made this space to separate the waters of the earth from the waters of the heavens.