The lamenting may refer to the suffering which the Israelites were experiencing under the hand of the Philistines, or the fact that the ark is no longer available to them at Shiloh.1 Their mourning was not an expression of resentment or self-pity, (Revelation 16:10–11), but rather a true remorse that led to genuine repentance (2 Corinthians 7:10).2
2 From the day that the ark was lodged at Kiriath-jearim, a long time passed, some twenty years, and all the house of Israel lamented after the LORD.