The Israelites did what was evil in the Lord's sight. So the Lord handed them over to the Midianites for seven years.
Read & study FBV 6:1And the children of Israel did that which was evil in the sight of Jehovah: and Jehovah delivered them into the hand of Midian seven years.
Read & study ASV 6:1