If I'm shopping for a Senior Widget Maker (a high paying job), I want to know that I'm getting someone who is truly a Senior & not a junior-wannabe.
One (not very good) way to gain that reassurance is to ask what you made in your last job, with the presumption that if I'm offering a small bump (10% - 15%) then your previous employer probably considered you to be pretty good. If your last job paid a tiny fraction of what I'm willing to pay, then there is too great a risk that you're a pretender and this won't end well.
(I'm not personally advocating this line of reasoning, but I've seen it often enough).
The trick is to so thoroughly convince the interviewer that you're the right fit for the job that the interviewer blows off the question as obviously irrelevant.
If they insist on asking, you have a couple of choices
My previous salary is not relevant; I was in a different field/industry/city
My previous employer considers that information confidential
For personal reasons I was deliberately underemployed so I could take care of my sick aunt. She is no longer with us, and it is time to get back to work.
That information is not available.
Zero. I took some personal time.
Zero. I do not wish to be boxed into my previous pay grade
(sometimes straight up honesty works well)
I'm sure there are others. Don't be defensive about the question or your answer. The goal is to get past this hurdle as quickly as you can.