Even though the land was given to the Israelites, they failed to fulfill their part of the bargain. The Lord promised that He would go before them and drive the inhabitants out of the land, but the various Israelite clans failed to dislodge all the people living in the land they were to occupy.
Reading between the lines, it looks to me like they tried to do God's will in their own strength, without invoking the presence and power of the Lord. There is no mention that they asked the Lord to go before them in their campaigns.
When God gives us a job, we need to complete it. But we need to do it exactly as He said to do it. When we try to do God's will in our own strength, we always fail.
God told the Israelites that because they failed to complete their mission, the inhabitants of the land would be a thorn in their sides and their gods would be a snare to them.
We need to be careful to rid ourselves of those things that can be a stumbling block for us. God has promised never to leave us nor forsake us. But we need to do our part in driving out those things which distract us from Him and His will for our lives. Otherwise we, too, will have thorns in our side and snares waiting to trap us.
Help us to clean house in our lives. Shine the light of Your Holy Spirit on those things which would distract us from Your will, and go before us as we drive out everything but You.
In Jesus' most precious name.