The moments surrounding King David's return to Jerusalem are marked by the submission of rebels and efforts toward reconciliation. During this transition, Shimei ben Gera seizes a narrow window of opportunity to save his own life.
To facilitate the royal return, preparations were made to cross the river. The primary approach among commentators is that a small boat or ferry was used to navigate the water. However, others suggest this crossing was accomplished using a bridge, by a designated group of people, or even metaphorically represents the collective decision passed among the nation to restore the king [ביאור שטיינזלץ, רד״ק]. The physical purpose of this crossing was to transport the royal household, specifically the women and children who could not cross the water on foot [רד״ק, מצודת דוד]. Alternatively, the focus was on transporting the king himself to officially reinstate his rule [ביאור שטיינזלץ].
The people carried out these actions to do what was pleasing to the king. Some interpret this as an attempt by the nation to flatter him, hoping he would extend forgiveness to Shimei [מצודת דוד]. In contrast, another perspective suggests that the people welcomed the king back unconditionally. By doing so, they left the absolute power to punish or forgive the rebels entirely in his hands. This realization struck fear into Shimei and propelled him to take immediate action [מלבי״ם].
Terrified of the consequences, Shimei fell before the king, bowing in deep submission to beg for a pardon for his previous sins [רלב״ג, רד״ק, ביאור שטיינזלץ]. This dramatic encounter took place exactly as the king arrived to cross the Jordan River. Shimei's timing was highly calculated. He rushed to seek forgiveness before David actually crossed the water. As long as David remained on the other side and had not officially reclaimed the throne, his legal status was that of an ordinary person, which allowed him to waive his personal honor and grant forgiveness. However, the moment he crossed the river and resumed his active role as king, Jewish law would dictate that a monarch cannot waive his honor, making any chance of a pardon impossible [מלבי״ם].