Mohammed (600+ A.D.) borrowed what was already taught to Christians. Then he paid lip service to, and modified, those beliefs he chose to help bring in some on-the-margins mostly ignorant Arabs who had heard of those Christian ideas.
He used the word Messiah as a name to the ignorant, and absent its meaning.
Well, what it seems Mahomet borrowed from was a lot of Gnostic heresy rather than anything in the canonical New Testament. Notions of Jesus speaking in the cradle, and also not really being crucified, came from such sources and landed right in the Koran. These are things that Christians rejected.