I've always tried for at least 15% raise each move [1]. If you are desperate, they'll figure it out and lowball you. The last 3 jobs have been 50%, 50% and 33% raises. Confidence does sell, but you also have to produce your value [2]. I'm not at the top of my pay-band for folks of my age and experience, but I am slightly above median for Denver.
2000 and 2001 were terrible years for developers. You'll hear them described as all sorts of terms, including "dotBomb." It took me 8 years to get my salary back to the same dollar amount I was making in 2000. And that 8 year period included 2 years I was out of work (23 months spread over 3 gaps).
There is a saying that goes "make hay while the sun shines." Aside from the obvious agricultural meaning, it also means that you should make as much as you can during the rich years, and put some aside for the lean years [3].
My estimation is that there are really 2 job pools. One for junior level skills and one for senior level skills. There is a large gap in salaries. When execs and politicians whine about a shortage of experienced workers [4], they're complaining that the senior pool is too expensive. However, all their options of making colleges produce more workers, or opening the visa flood gates will only serve to increase the quantity of folks in the junior pool. It takes time, training and effort to move yourself from the junior pool to the senior pool. But it will be up to you - no company will do it for you, and indeed, with the constant demand for workers who can "hit the ground running" that shows that companies want the benefit of the senior pool without contributing to the succession from the junior pool.
Notes:
1 - Companies who ask what you are making now will usually try to limit you to 10-15% raises with your new position. Part of this is a cultural dislike for people moving up too fast. Victorian literature was full of tales of people who tried to move to another "station in life" and were found out then sent back to the lower classes they came from. This is the sort of mentality you'll find during interviews.
2 - Confidence will get you in the door, but you have to get work done to keep your job.
3 - This is not limited to retirement savings. By age 28-30, you should have about 6 months income saved up for the times when you will be out of work. By 35, you should have more like 12 months saved up. That is your lifeboat and the only way you can survive the ups and downs of the industry. Developers over 40 who get laid off can find it takes 6-12 months to get a replacement job.
4 - Mostly they want protection from the free market, but usually what's happening is that they think they need senior level workers but are only willing to pay junior level wages. So they want some sort of bailout from the government.