According to Scripture, the earth, as well as the rest of the universe was created by God out of nothing (ex nihilo).
"In the beginning God created the heaven and the earth." Genesis 1:1. The Hebrew word for created is "bara," which means to create in an absolute fashion. Eternal God created the Heaven and the earth. Hebrews 11:3 endorses this by saying: "Through faith we understand that the worlds were framed by the word of God, so that things which are seen were not made of things which do appear."
Yet, one might notice that this is received "by faith," since God said it. No man was present to witness this creation of the universe, so it requires belief in what God said.
Whereas some would say that the Bible is only man's words, the Scriptures consistently maintain that the words came from God. Peter said: "The prophecy (of the Scriptures) came not in old time by the will of man: but holy men of God spake as they were moved by the Holy Ghost." 2Peter 1:21. To demonstrate this, Daniel prophesied the major empires of world history, after the Babylonian Empire, before they came to existence. The empires materialized exactly as he said, yet Daniel maintained: "As for me Daniel, my cogitations much troubled me..." Daniel 7:28.
Therefore, the account of creation according to Scriptures is considered by many to be the way the earth came into being, taken by faith.
Mark