It's common for the prevailing wage to be double what that person could earn in their country of origin.
You don't need the carrot of a green card or the stick of deportation to make a software engineer on an H1B accept a depressed wage, because it's not depressed relative to their alternatives.