I was thinking about how Christianity was formed in the realm of Judaism, while Islam was formed in a realm of Semitic polytheism (like Judaism) yet is still Abrahamic and talks about Adam and Eve, Satan, Abraham, Noah, Moses etc.
How would Muhammad have heard these stories enough to create a religion around it separate from the Judeo-Christian sphere of influence? Were there other believers before Muhammad in Mecca or Medina, or was it almost 100% dominated by Arab polytheism?
The Arabian peninsula was actually the home of many Christians and Jews. They were also divided into many different sects - some followed the 'Nestorian' brand of Christianity popular in Persia, others were miaphysite Christians like those from Ethiopia, Egypt, and Syria. There were even less well-known groups, such as a community of Jewish Christians that may have been present in the region. As for adherents of Judaism, some Jews seemingly migrated into Arabia during the various Jewish revolts against Rome. By the early sixth century, a Jewish king ruled the kingdom of Himyar, modern-day Yemen, though the precise nature of the form of Judaism they practised is still debated. There were also Jewish groups outside of Yemen, most famously at Medina, where there were three Jewish clans when Muhammad arrived after he had escaped from Mecca.
These groups were not isolated either, but played an important role in the events of the sixth century and thus had set the scene for the rise of Islam. Though the evidence is still not entirely clear, the Christian Ethiopians invaded Yemen sometime before 522 and ruled over the region. In 522, a Jewish king, Yusuf, expelled them from Himyar and embarked on a pogrom against local Christians. The best sources for this, the fragmentary Book of the Himyarites and a letter preserved in the Ecclesiastical History of John of Ephesus, painted him as a monster hell-bent on torturing Christians, but I suspect other factors were involved as well. The Greek historian Procopius for instance mentioned that the control of Yemen was important for trade, whilst even the pro-Christian accounts implied that the Christians were not entirely innocent - one of the martyrs' father for example had burnt down synagogues, presumably during the previous period of Ethiopian occupation of the region. Another martyr had apparently served Yusuf's Jewish predecessor, which may suggest that the king's persecution had a political motivation behind it as well, as this would imply that religious divisions were not always so deadly. There also seems to be some existing links with Roman Palestine, since for some reason one source described a few Jews from Palestine as Yusuf's envoys, whilst another source, a letter dealing with the fallout of a pogrom, suggested that the Romans should arrest rabbis in Palestine in order to pressure the Himyarites to stop their persecution of Christians.
Regardless of the cause, this conflict quickly spiralled out of control and became a religious issue for all neighbouring powers, profoundly changing the status quo in Arabia. Under a pagan Arab chief of the powerful Lakhmid confederation, who was also an ally of the Persians, a conference was convened at Ramla in 524, one that brought the Romans, Persians, and the Ethiopians into the picture. Though the precise results of the conference will probably never be known, it appears likely that the Persians threw their weight behind the Jewish Himyarites in order to counter-balance the Romans. At the same time, Ethiopian irredentism over Yemen was stoked by Roman support, as Rome and Persia were engaged in a cold war at the time. The Himyarites' allegiance was actually quite important in the grand scheme of things, since the three pre-eminent tribal confederations in Arabia at the time all had ties with one of the powers involved: the Ghassanids with the Romans, the Lakhmids with the Persians, and the Hujrids with Himyar. Moreover, the Ghassanids were miaphysite Christians, whilst the Lakhmids were pagan but ruled over a large Christian minority. I can't recall what brand(s) of faith the Hujrids followed unfortunately, but regardless of their belief(s), Arabia was now drawn incontrovertibly into the schemes of the great powers, with faith being a key motivator for many of the people involved, simply because much of Arabia was dominated by powers aligned with one faith or the other.
The Ethiopian invasion of 525 quickly removed Yusuf from his throne, but that was not the end of the struggle. The eventual Ethiopian strongman who seized power in the region, Abraha, had grand pretensions and eventually proclaimed that all of Arabia was under his domain, something that was obviously nonsense given the continued pre-eminence of the Ghassanids on the Syrian frontier and the Lakhmids on the Mesopotamian frontier. However, Abraha did repeatedly emphasise his Christian faith, so for a time southern Arabia was dominated by a Christian ruler with active links to Constantinople, since the emperor Justinian wanted Abraha to harass the Persians and their allies within Arabia. He even campaigned in the Hejaz, so presumably he was still remembered by the time of Muhammad a generation later. Abraha was also aware of the need to placate local Jews and so was careful not to offend them. After Abraha's death however Christian rule over Yemen was soon overthrown, as dissent, perhaps led by local Jews, eventually led to the Persians to intervene and seize control of the region.
By the late sixth century the situation in northern Arabia also became more complicated, as both the Ghassanids and the Lakhmids lost the favour of their patrons and Roman/Persian support was instead given to a number of smaller tribal groups on their respective frontiers, though notably the last Lakhmid chief had converted to Christianity from paganism, which might explain his downfall at the hand of the Persians. This did not mean that Arabs were now more distant from the affairs of the two imperial powers however, since Arab soldiers continued to serve both sides, whilst Persian influence was still strong on the coast. The evidence is less clear for Roman involvement in the region, but apparently there are signs that they continued to try to control the trade passing through the Red Sea.
The Arabia Muhammad lived in was therefore a religiously diverse place, one that had experienced both persecution and toleration between different brands of Abrahamic monotheism. Indeed, if we follow the account found in the traditional account of Muhammad's life, then his wife's cousin was a Christian, that a group of early Muslims had fled to Christian Ethiopia, and that Muhammad had travelled to Syria in his youth and had met a Christian holy man there. Though there is little contemporary evidence to substantiate this, such as through inscriptions, these events fit well with the religious milieu of the time. Christianity and Judaism were not oddities in Arabia, but two ancient faiths that long thrived in the region and had in the last century led to major conflicts between long-established states. By the time of Muhammad the principal actors in these disputes, the Himyarites, the Ethiopians, the Ghassanids, and the Lakhmids, had all declined in power and prestige, but their legacy was surely not forgotten. After all, an often told story from Mecca is that of the 'Year of the Elephant', when Abraha led his army (and an elephant) to attack Mecca in the year of the Prophet's birth. This attack probably happened in 552 and so not actually in the year Muhammad was born, but the preservation of this story tells us a lot about the religiously diverse context Islam was born in. With this in mind, I think it would be more odd if Muhammad had known nothing about Christianity and Judaism, simply because of how connected Arabia was with the wider late-antique world.
Much of this story can be found in G. Bowersock's excellent The Throne of Adulis: Red Sea Wars on the Eve of Islam (2013), which is a book specifically aimed at the general public. A more academic book would be T. Power's The Red Sea from Byzantium to the Caliphate, AD 500-1000 (2012). I also didn't talk much about imperial interventions into northern Arabia, for which G. Fisher's Between Empires: Arabs, Romans, and Sasanians in Late Antiquity (2011) is an excellent overview. For more controversial views, such as Patricia Crone's argument that some Arabian 'pagans' were in fact Abrahamic monotheists, see 'The Religion of the Qur’ānic Pagans: God and the Lesser Deities,' Arabica 57 (2010). Fred Donner's Muhammad and the Believers: At the Origins of Islam (2010) provides another interesting take on this issue, as he argued that Muhammad's movement was originally an ecumenical group fully inclusive of Jews and Christians, which I think makes a lot of sense given the context of the time, but not everyone agrees with this!