Muslims consider Jesus, Moses, and Abraham to be prophets. Where did Muhammad learn about them? Or did he learn about them later and say “Hey, that guy sounds pretty good. He must have been a prophet?”
By the time Muhammed was born (about 570 AD), Christianity was widespread, including some communities in Arabia. In addition, Jews has been scattered following the destruction of the Temple in Jerusalem in 70 AD, and there were Jewish communities in Arabia. So it would have been inevitable that anyone interested in religion in 6th century Arabia would have heard about both religions.
The Jewish communities in Arab land were probably converts to Judaism, not Hebrews having moved into Arab territory (besides, is there really proof that there ever was an exodus from Palestine in 70 AD? I’m talking factual, historical proof, not Sunday school bullshit).
There were powerful Jewish clans in Mohamed’s area, as well as Nestorian Christians. They had a big influence on him, and played a part in his rise to power.