You got this backwards: we build housing for the influx of population. People don't move to new places just to get a new house. They move for economic reasons, like they got a $150k software dev job in SF & don't want to commute 90 minutes each way, or they got evicted so the landlord could double/triple the rent.
Regardless of whether SF builds now housing stock or not, the population influx is already happening and has been happening for the last 10 years. The issue is, new, wealthier residents are pulling the market up and forcing existing, lower-income residents out to the periphery of the Bay Area.