Most of the type of people who would vote against Pelosi can no longer afford to live in her district, so she's extremely safe.
Yup, those who work at low pay jobs in San Francisco are increasingly living in places like Stockton, which had the percent largest increase in rent this last year of any city in the country. But if you're an out of touch self described capitalist worth 9 digits like Nancy Pelosi, then you can suck up space in San Francisco.
Describing yourself as a capitalist is actually very 'in-touch'. This is not a socialist country, and it never will be.