Muhammad did not know, but the beings who told him did. It is also worth noting that many of the statements in the Quran, are told by Greek and Iranian and other scientists four hundred to a thousand years before muhammad, such as the stages of the creation of child in the mother's womb and childbirth, which are mentioned in the Quran, were written by a scientist four hundred years before Muhammad (I don't remember his name) in his book.