By law, an employer is required to pay H1-B at least as much or more than the US market average for the given position.
By law maybe, but it reality, far from it. Employers use foreign contractors to save money, not because they can't find someone in the US at the "market average" price, but because they can find a foreign worker and illegally pay them less.
That's another reason the smart ones may be leaving. They have priced themselves out of the market. The came over with dreams of making a nice "American" salary and are leaving disappointed. Companies want cheap labor.