Complex sentence: When the Nizam Shahi dynasty was on the verge of collapse, Shahaji Raje came to their support, but the Mughal emperor Shahajehan and Adil Shah of Bijapur both sent their army separately to defeat Shahaji.
Split into simpler sentences: When the Nizam Shahi dynasty was on the verge of collapse, Shahaji Raje came to their support. However, the Mughal emperor Shahajehan and Adil Shah of Bijapur both sent their armies separately to defeat Shahaji.