That's why a bunch of companies ask what your previous salary was in interviews and why you need to absolutely not give that number in pretty much all circumstances.
Like I got a 60% bump from my previous salary my last job search, in part because I hadn't gotten raises for several years at my previous company as they had wage freezes, and in part because I had been behind on compensation for a while due to having to take whatever halfway decent jobs I could get while unemployed, but if the prospective employer knew I was getting paid so little, they probably would have significantly lowered the salary they offered to me, and I'd still be behind the market rate for my skills, and the next time I went looking for a job I still wouldn't be offered enough to catch up to what I'm making now. It's a vicious cycle when they know your current salary.
Even for that 60% bump, that was after talking to 20 recruiters over the phone, 8 online code exams, 5 multi-stage interviews, and getting 2 offers, over an exhausting three week period, and juggling all those with a day job was super difficult, and I had to schedule enough of those during the work day that it got to the point where my former boss probably started to notice.
I'd hate to have to double, triple, or quadruple that effort just to get maybe a 30% bump if my previous salary was public knowledge.
I managed to get a significant salary bump even without having a job, because I made sure they understand from the beginning I'm happy to walk away.
After the dot com crash, I took lower paid work in the public sector, working on some interesting things.
I was approached by a recruiter to work for a company that was basically the best possible fit. They were working on a product category that I had helped to define at a previous start up, where I was the chief technical architect.
Once I told the recruiter my current salary, he was no longer interested. He even sounded aghast. Couldn't possibly put me forward for the role.
"In my previous job, I deliberately took a below-market rate to work in the public sector, as a form of service to my community. I don't consider that salary relevant for this discussion."
End of story. I'm fortunate to be in a place where broader salary statistics are available, so from there I simply redirected the conversation to "here's what I'm seeing as the range of market rates here, and why I think I deserve to be on the high end of that", and that was fine.
Remember: in this industry, your BATNA (best alternative to a negotiated agreement) is...just walk away, and answer the next recruiter who's begging for your time. If they can't consider putting you forward because of an arbitrary number from a non-comparable position, well, that's their problem and their loss.
They know that the typical case is that salary maybe increases by 10% (number pulled from thin air here) and calculate if the effort is worth it for themselves.