As a member of the House of Representatives, she has to run for re-election every two years, so theoretically she is up for re-election on November 4. But being a D rep from San Francisco, she is pretty much assured of winning back her seat every time she runs until she dies or decides to step down. There is no way anybody could unseat her in one of the most liberal districts in the entire country. She knows that she is safe - which is why they should impose term limits on Congress.
In the "You Learn Something New Everyday" category - I went searching for Nancy Pelosi's opponent in the 2020 general election and discovered that since 2010 California has followed what is called the "Top Two" primary system. Essentially
all of the candidates running for that congressional seat appear on the spring primary ballot and the top two vote getters -
regardless of their party affiliation will appear as the two opponents in the November general election. So it is possible (and in that district downright
likely) to have two Democrats running against each other on the November general election ballot.
I'm not sure how that system benefits the public, but it
does allow for the possibility of a popular or charismatic Democrat to unseat Nancy Pelosi. But like I said before, sometimes it is better to keep the evil that you know in power than to put in an unknown.
FYI - Pelosi won her 2020 primary with 74% of the vote (191,000 votes). Second place took 13% (33,000 votes). There is nothing to suggest that she wouldn't crush this same opponent by the same margin or more in November.
Sources: https://www.presidentialelectionodds.net/candidates/nancy-pelosi/https://ballotpedia.org/Top-two_primary