I have a question about Gen 37:28. I’m reading from The Five Books of Moses. Why would the foreign travelers be described as Midianites and Ishmaelites?
In general, "Ishmaelites" was used generically to describe the entire group of nomad traders in or from the vast area of Gilead (37:25). These people were a "blend" of the descendants of Avraham - not just the descendants of Ishmael. (True "Ishmaelites" descended from Hagar (Gen 16:15), while those known as Midianites descended from Keturah (Gen 25:1-2).)
So the caravan of traders of 37:25 was likely a large group of traders, consisting of "clans" of men identified by their common ancestry and common "trade". Within this caravan of "Ishmaelites", we know, were some Midianites because they are named in 37:28, and probably other "clans" also descendants of Avraham were present though they are not mentioned.
But the Midianites were singled out as the caravan passed because the Midianites did not just trade in "goods", they also traded in slavery (37:28). It would seem Joseph's brothers were quite aware of that. We can conclude that the traders, as a whole, were referred to as "Ishmaelites" because we see in 37:36 that the Midianites sold Joseph to Potifar in Egypt, while in 39:1 this same group is referred to as Ishmaelites.