In the Biblical accounts of Joseph and of Gideon the Midianites and Ishmaelites are mentioned interchangeably. There are different interpretations concerning this. The Dutch Studiebijbel * offers the following explanation in Genesis 27:
“It may be that “Ishmaelites” was a general term for “Bedouin” or “nomadic merchants” and “Midian” a term for the specific tribe to which they belonged.
It is also possible that “Ishmaelites” was a collective name for a group of tribes, of which the Midianites were one. From a distance (v.25), all were seen as “Ishmaelites,” but when they came near, it turned out they were “Midianites” (v.28).”
The fact is that both groups descended from Abraham and lived in the east (Genesis 25:6). Their family relationship and common profession provided a strong foundation for establishing covenants by intermarrying. This provides the possibility for the selected interpretation in the story.
For more discussion on this topic, see the article Ishmaelites.
* Studiebijbel Oude Testament, Bijbelcommentaar Genesis, Exodus, Centrum voor Bijbelonderzoek, Veenendaal, 2009.