2 Samuel 19:3

And the people gat them by stealth that day into the city, as people being ashamed steal away when they flee in battle.

Cross-reference

In 2 Samuel 19:8, David sits at the gate to welcome the people — the resolution of their shameful sneaking into the city described here.

2 Samuel 17:24 Historical context

2 Samuel 17:24 sets the battle at Mahanaim — the context for the people stealing into the city as if fleeing from that battle.