The Lodi dynasty had its origins in the Afghan Lodi tribe. Bahlul Lodi was the first to rule Delhi Sultanate from 1451 to 1489, and the one who started the dynasty.
After Bahlul Lodi died, his son Nizam Khan assumed power, rechristened himself as Sikandar Shah Ghazi Lodi and ruled from 1489 to 1517.
Sikandar Lodi expelled his brother Barbak Shah from Jaunpur, installed his son Jalal Khan as the ruler, then proceeded east to make claims on Bihar. Sikandar Lodi died a natural death in 1517, when his second son Ibrahim Lodi assumed power.
Ibrahim attacked and killed his elder brother Jalal Khan, who was installed as the governor of Jaunpur by his father and had support of the amirs and chiefs.
After Jalal Khan's death, the governor of Punjab, Dawlat Khan Lodī, reached out to the Mughal Babur and invited him to attack Delhi Sultanate. Babur came, defeated and killed Ibrahim Lodi, during Battle of Panipat in 1526.
Ibrahim Lodi's death ended the Delhi Sultanate, and Mughal Empire replaced it.