According to the Quran, the advent of the final prophet, Muhammad ﷺ, had been foretold and was awaited since ancient times.
The world at the time of the Prophet was dominated by two great and ancient empires, The Eastern Roman Empire and the Persian (Sassanian) Empire. For hundreds of years, these two superpowers had competed for domination of territory and military superiority, and borders would shift here and there depending on which side was currently gaining the upper hand.
The Roman Empire had embraced Christianity as its official religion back in the 4th century, with the conversion of Emperor Constantine. It was Constantine also who moved the capital of the empire to the new city named after himself, Constantinople. In the 5th century, the western half of the empire had collapsed under the invasions of Barbarian tribes, but the Eastern Empire endured, and the emperor at the time of the Prophet was called Heraclius.
The Persians, on the other hand, followed the religion of Fire-worshippers, Zoroastrianism. There were also many Christian and Jewish communities within the Persian lands.
Far to the east of the Persian Empire, over the Afghan mountains, was the vast and fertile land of 'Hind' (India). And further east still lay the ancient civilization of the Chinese. Both the Indian and Chinese civilizations were wealthy and highly advanced in terms of learning, culture and technology. Future Muslim scholars would benefit greatly from the wisdom and learning of these two ancient civilizations, for example, the learning of paper-making from the Chinese (which allowed the mass production of books and spread of learning) and advanced mathematics from the Indians.
In areas outside of the 'civilized' world, such as the Great Eurasian Steppe and the Arabian and Sahara deserts, where the environment was harsh and inhospitable, lived nomadic types, such as the Arab Bedouins and Steppe Nomads. These people did not have official legal systems (judges or courts) and were usually organized in tribes. In the absence of law and order, clan and tribal solidarity was essential for survival.
The tribes were usually pastoralists (owned flocks/herds of animals) and had to migrate from place to place to find pasture for their animals. They lived on the edge of existence and life was tough for them. Clans and tribes often fought each other violently for animals or booty, and sometimes just for vendetta and revenge. Despite their lawlessness, they strictly adhered to a certain 'tribal code', which they all considered inviolable.
Growing up in such harsh conditions, and constantly fighting and feuding, naturally made these nomadic people into super-tough warriors. As a result, they were feared by the empires outside whose borders they roamed, in case they try and enter imperial lands and disrupt the settled peoples. The Romans called them 'Barbarians', meaning 'uncivilized', and the name stuck.
The Arabian Bedouins were a typical nomadic tribal people, endlessly occupied in blood feuds and raiding between clans and tribes. The Arabs were mainly unlettered (could not read or write), but they exulted in their language, a particularly rich and eloquent classical tongue which found expression in sophisticated poetry. The vast majority of Arabs had sunken into idol worship and polytheism, although some isolated individuals still remained upon the monotheism of the ancient prophets, Abraham and Ishmael. Several Jewish settlements were dotted around Arabia. Three Jewish clans lived in the oasis town of Yathrib, for example, which they shared with the Arab Aws and Khazraj tribes. Christianity was also well known to the pagan Arabs, some of whom had converted.
Ancient prophecies around the world foretold of the coming of a final Prophet before the Last Days. Many of the poor and oppressed in the world eagerly anticipated the coming of this saviour, who it was said would lead his holy followers to topple the oppressive rule of tyrants everywhere, and establish justice, peace and freedom of worship for everyone, rich or poor, master or slave.
The People of the Book (Jews and Christians), in particular had detailed prophecies and descriptions about the great prophet to come. In fact, they held such accurate and detailed information in their sources that the Quran said
They know him (i.e., the final prophet) like they know their own sons.
(Quran 2:146)
It is amazing that several Jewish clans had settled in Yathrib and were living there precisely because their sources told them that this would be the city of the final prophet.
The early Christians, followers of Prophet Jesus (upon him be peace), were also focused on the anticipated advent of the final prophet. Jesus had been persecuted by the Jews and they conspired with the Roman authorities to have him executed. God saved Jesus and promised him and his followers that He will soon send the 'Son of Man', who will be given victory over the enemies of God, and will usher in the Kingdom of God on this earth. Some Christians, called Milennialists, believed that the Kingdom would endure a thousand years, in which justice and the Divine law would prevail.
According to the historian, Bart Erhman, when Jesus spoke of the anticipated coming of the 'Son of Man', he was not talking of his own second coming, but about a different prophet who was soon to come.