The Lord is referring to the time between Israel’s entrance into the land and the period in which David lived, the time of the Judges. Throughout this time the people of Israel faced opposition from the nations around them with various nations attacking them and making their lives difficult (see Joshua 1—1 Samuel 31).
10 And I will appoint a place for my people Israel and will plant them, so that they may dwell in their own place and be disturbed no more. And violent men shall afflict them no more, as formerly,