Google, Facebook, Amazon, and whatever other big name you want to throw in the pot, are competing for developers. However, they are not competing for the same developers as Epic Systems, for example. FAANG (or whatever) are competing for a highly skilled subset of devs that can meet their demanding hiring criteria. Similarly, top law firms are only competing for a subset of all law grads -- those that meet their demanding hiring criteria.
The difference here is that, in law, that criteria is focused around a prestigious degree. Presumably, this is because it is hard to thoroughly test a lawyer's competency as a lawyer in an interview setting. However, in programming, many top companies, apparently, find that a series of intense whiteboard interviews are sufficient to determine whether or not a dev meets their high standard.
However, we also have a shortage of devs across the board, for all companies. If CS enrollment increased by 100%, then presumably the "lower" distribution of salaries would stabilize at a lower number -- probably close to what traditional engineers make nowadays. However, the salaries of the GooBooks of the world will only be affected if a sufficiently high proportion of those grads can meet a very difficult hiring criteria.
Similarly, law schools have seen a dramatic increase in enrollment over the past few decades. Lower salaries have stabilized, since the market is now saturated. However, the salaries for top law firms remain high, because a similarly low number of candidates meet their difficult hiring criteria: Harvard, Yale, and etc. are producing more or less the same number of law grads as before, with respect to demand.
This is why Google can open an office across the street from Epic and yet still pay devs twice as much. This is also why I don't think immigration is a huge factor. Sure, if companies were able to immigrate significantly more workers, then salaries at top companies might drop to a degree. But the real drop would be seen in the salaries of devs at typical companies.
EDIT: grammar