From what I was taught, he was a part of Aurangzeb's court. He had an incredible knowledge regarding the quran, and blew Aurangzeb away when describing an arth. Aurangzeb wanted him to convert him, if he refused, he would've been killed. He sought refuge at the darbar of Anandpur Sahib. And the rest is history.
Bro is talking about Devi Devte when he believes Muhammad rode on the Buraq from Mecca to Jerusalem which is described as being a white animal, half-mule, half-donkey, with wings on its sides. Now I would provide a picture... But eh... What's the point.