Barani was a contemporary of Muhammad bin Tughlaq and Firuz Shah Tughlaq both. He wrote a number of renowned texts, such as the Fatwa-i-Jahandari, which elaborates on the principles to be followed by Muslim rulers to attain merit.
It is believed that Babur was invited to fight against Ibrahim Lodhi by Daulat Khan Lodhi , the Governor of Punjab, AlamKhan, the uncle of Ibrahim Lodhi, and Rana Sanga of Mewar.