In fact, Mohammad had no such knowledge whatsoever. The fact that he was illiterate is explicitly stated in Quran. According to the Islamic faith, neither Quran nor Tora were written by mere mortals. Moses, Jesus and Mohammad were not "writers". They didn't make things up. They were only "messengers".
As for your anti-Islam rhetoric, it only proves my point about religious hatred.