The short answer is that nothing has to happen to them. Sites lose rankings in a rebuild because of one specific mistake, and it is avoidable.
Google doesn't rank your website
It ranks individual pages, each at its own address. If you have had a site for a few years, some of those addresses have earned something. Maybe /services/pool-cleaning/ is the reason you show up when someone nearby searches for it. That address is the asset, not the site as a whole.
A rebuild usually changes the addresses. The old page becomes /what-we-do/pools/, or /pool-service, or it gets folded into a single services page. If nothing tells Google where the old address went, it returns a 404 and everything that page earned goes with it. The new page starts from zero. That is the drop people describe as losing their rankings after a redesign.
The fix is a list
Before the new site goes anywhere near production, every address on the old site gets written down next to the address it will live at on the new one. Old page on the left, new page on the right. When the new site launches, that list becomes 301 redirects, which tell Google the page moved permanently and to carry what it earned to the new address.
It is tedious and it is not optional. On a forty page site it is an afternoon. I do it before writing any code, because once the new site exists it gets much harder to remember what the old one had.
Two things worth doing with it
Build the list from Search Console, not from the old site's menu. The pages that earn traffic are often ones nobody remembers, and they are usually not in the navigation. Export every page that got an impression in the last year and start there.
Check the redirects after launch, not before. A redirect that works on your laptop can still be wrong in production, and the window where it matters is the first few weeks while Google is recrawling. Pull up the old addresses and watch where they land.
What to ask whoever is rebuilding your site
Ask to see the redirect map. If there is one, you will be handed a spreadsheet. If the answer is that the new site is better so it will rank better, that is not a plan, and your traffic is going to take the hit.