There are several different situations which are getting jumbled together in this discussion.
First, there are two categories of visa workers at issue. One group is top talent from around the world which Silicon Valley employers want to hire to design their products. They will get paid top money, given all the perks, get stock options, etc. Some of these people will rise to the top of the company, or go out and found their own companies.
The other are lower paid workers who do more routine jobs, everything from writing more run of the mill software to doing IT maintenance. Big Indian outsourcing companies bring these people into the US, pay them Indian wages, and in many cases rent houses and pack them full of these people. These people get brought into replace American workers at a lower price. Americans workers get introduced to them, told that this is their replacement, and they will train them in how to do their job after which they will be made redundant. Also, because their visa is held by their employer, if the contract workers ever complain about anything at all, they will get sent back to India and replaced with anyone else. Abuses are reportedly quite common.
There is a US work visa which is intended for the first category of worker. However, there is a limited supply of visas and big outsourcing companies will scoop them all up to use on their low wage second category workers so the tech companies who want first category workers can't hire who they want.
This has led to the situation where there are numerous Americans losing their jobs in the tech industry while companies (everything from banks to software companies) complain that there is a shortage of people with the necessary skills. Some of this apparent contradiction is simply due to the outsourcing companies getting most of the visas so there are not enough for the companies who were supposed to be getting them. Some of this is some companies, the finance field seems to be particularly prone to this, wanting to drive wages down as low as possible.
Some of it is also that you get managers from an Indian outsourcing company in charge of hiring people in the US to fill positions that are supposed to be filled with Americans. They will advertise the job in the US and will get qualified people applying for them. They will however f*ck them around and delay their applications. Then eventually these Indian hiring managers will report to the American company that they can't get any qualified people in the US, but they have 'x' number of people from one of their affiliates in India that they can have on site in the US in two weeks. They fill the position with one of their Indian contractors and take a huge chunk of his pay on top of the much smaller commission they would have got from hiring an American.
One of the things which Trump did was to try to address the above, although it took him years to get around to it. I can't recall exactly how it worked, but I think it amounted to putting a minimum salary limit for any work visa being granted of this type. This would not affect companies who genuinely wanted to hire top talent from around the world, as they would be paying more than that anyway.
Companies who just wanted to replace American workers with third world workers at third world wages however were rather rapidly ejecting teddies from prams at warp speed when they heard this, as it undercut their business model.
With regards to people leaving Silicon Valley to live elsewhere in the US, again there are several different aspects to this. If you have ambitions to climb the ladder in your company, or switch between companies to climb ladders there, or to make the connections which will let you found your own company, then Silicon Valley is the best place to be. There are all sorts of connections to be made there, and there are numerous employers doing similar things in the same area so switching jobs just means driving to a different building in the morning as opposed to moving to another city.
If climbing the ladder isn't your ambition, and if you have concluded that you personally will never be a billionaire, then Silicon Valley is not the place to be. If you are starting out now, or even worse, have just recently married, you will never be able to afford to buy your own house there. You can move to somewhere else in the US, accept a lower pressure job at a lower wage, and still be able to see a significant increase in your standard of living.
There are also companies who many have started out in Silicon Valley but whose best days are behind them. They have a stable or declining customer base for a well established but no longer cutting edge product line, and they are just looking to manage their inevitable decline. These companies are moving out of Silicon Valley to places with lower costs. They don't care if cutting edge talent is harder to come by in their new home, as they aren't doing cutting edge things any more. They're more focused on finance and marketing than technology and engineering now.