How did the world get here?
That question didn't start with the ancient Israelites and it probably won't end with us. Our scientific attempts to explain the origin of the universe are speculative and mostly unverifiable. The field of cosmology has made some progress, but it's still more philosophy than science.
Since we're stuck with philosophy anyway, what does the Bible say about the origin of the universe?
Everyone knows the answer by heart: "In the beginning, God created the heaven and the earth."
That's a literal translation of Genesis 1:1, Bereshit bara Elohim et ha shamayim ve et ha aretz. It's fine. The Jewish Publication Society's 1917 English-language edition of the Tanakh used it.
The phrasing suggests God created the world ex nihilo -- that is, out of nothing. At first there was nothing, then poof!, the universe appeared out of nowhere. That's our traditional belief. The Jewish sage Saadia Gaon devoted a whole chapter of his Book of Beliefs and Opinions to defending it. 
However, the historical context of the story suggests a different phrasing, used in the Jewish Publication Society's 1962 English translation:
"When God began to create heaven and earth -- the earth being unformed and void, with darkness over the surface of the deep and a wind from God sweeping over the water ... " 
That makes it sound like God did not create the world out of nothing. Something already existed, but it was unformed and void. God simply imposed order on a pre-existing chaos.
That interpretation has several things going for it.
First, it gets God off the hook for the existence of evil. If God created everything ex nihilo, then God created evil as well as good. The wicked prosper and the righteous suffer. Innocents get sick and die. People of conscience have agonized over the problem for millennia.
However, if God only imposed order on a pre-existing chaos, then evil already existed when God created the world.
That's more than just a convenient solution to the problem of evil: It's consistent with the text. Genesis describes the primordial world as unformed and void, containing "darkness" and "the deep," all of which symbolized evil to cultures in the time and place of the Biblical writers. An alternative translation of "unformed and void" (tohu ve bohu) is "welter and waste," connoting emptiness and futility, also evil. 
Second, it's also consistent with other ancient creation stories such as the Mesopotamian Enuma Elish, which was known to ancient Israelites. In the Enuma Elish, the god Marduk defeats the sea goddess Tiamat and splits her body into pieces, forming the waters above and below the sky. That clearly corresponds to the Genesis story, in which:
"God said, 'Let there be an expanse in the midst of the water, that it may separate water from water.' God made the expanse, and it separated the water which was below the expanse from the water which was above the expanse. And it was so. God called the expanse Sky." 
Many ancient peoples, including the Israelites, seemed to think of the primordial world as a vast amount of water. Moreover, contrary to what we know now, they believed that the sky was solid: for example, Exodus 24:10 refers to it as a "pavement of sapphire." Because the sky was solid, it could separate the waters above it from the waters below it.
A lot of God's creative activity in Genesis consists of separating things from each other and then naming them. That agrees with ancient ideas of what it meant to create things and what it meant for them to exist:
"In the ancient world something came into existence when it was separated out as a distinct entity, given a function, and given a name." 
In the Enuma Elish, Marduk acquires 50 different names when he becomes king of the gods -- one name for each function that would have been performed by a separate god. Likewise in the Bible, God has somewhere between 18 and 72 names, depending on who's counting.
So when God separates light from darkness, water above the sky from water below the sky, and names all of those things, the ancient Israelites would have considered it equivalent to creating them.
None of this means, of course, that the Genesis creation stories aren't true in the way that foundational stories can be true. But the Biblical text doesn't interpret itself. Knowing the intellectual and historical context in which the stories were first conceived and written down helps a lot when we try to understand their significance.
Alter, R., translator (2004), The Five Books of Moses. W.W. Norton & Company, New York. Kindle edition.
Brettler, M. et al, editors (2014), The Jewish Study Bible, second edition. Oxford University Press, Oxford, UK. Kindle edition.
Rosenblatt, S., translator (1948), The Book of Beliefs and Opinions. Yale University Press, New Haven, CT.
Walton, J. (2006), Ancient Near Eastern Thought and the Old Testament. Baker Publishing Group. Kindle Edition.
1. Rosenblatt, S. (1948), pp. 40-46.
2. Brettler, M. et al (2014), loc. 1230.
3. Alter, R. (2004), loc. 1007.
4. Brettler, op cit, loc. 1246.
5. Walton, J. (2006), loc. 1470.