2 Samuel 2:28

So Joab blew a trumpet, and all the people stood still, and pursued after Israel no more, neither fought they any more.

The verse belongs to the books of Samuel, whose great event is the establishment of a monarchy with Samuel, Saul, and David as the three leading characters. Within that larger frame it stands in 2 Samuel 1 to 4, specifically in the account in chapters 2 to 4 of the causes that led to David being made king over all Israel. That larger story carries the leadership from the aged priest Eli to Samuel, born in answer to prayer, then to Saul, given as king at the people's request and deposed for proving unworthy, then to David.

Its immediate time is when David reigns at Hebron but does not receive the kingdom peaceably, because Saul's son and army still try to hold the kingdom by force. It shows the lingering warfare between Judah and Israel in which David proved victorious. Behind these political changes was God's purpose to bring David to the throne.