Psalms 94:23

And he shall bring upon them their own iniquity, and shall cut them off in their own wickedness; yea, the LORD our God shall cut them off.

God brings the iniquity of those who plot against the righteous back upon themselves and cuts them off in their own wickedness, so that their wrongdoing is brought to an end. The Midianites who enticed Israel into sin are an illustration of this retribution. By leading Israel astray they set in motion their own ruin, for their own deeds brought destruction upon them.