After David became king of Judah (in the south), there was a long civil war with most of the tribes of Israel following Ishbosheth (Saul’s son and Mephibosheth’s uncle) in the north. After the David’s side one, he became king of the united Israel. Next David dealt with Israel’s external enemies - either winning wars or making peace treaties. After David’s kingdom was solidly established and Israel had a period of peace, David seems to have taken time to reflect on his promise to look after Jonathan’s descendants.
So basically, David seems to have forgotten about his promise (or to have been to busy to fulfill it) until there was peace. But then he did right by Mephibosheth. Even though it was late in coming, it was still a pretty courageous act, considering that David had fought a civil war against Ishbosheth.