Late 2012/Early 2013 there was a huge spike in gun and ammo sales due to political rumblings from the Newton shooting. Some of it was founded, much of it was a blind panic.
30 round magazines going for $10-15, were now $30-50. A $1000 AR15 could have easily been sold for $2000. There were extreme cases of where some guy sold a magazine for $80, or a $1000 rifle for $3000. It was nuts. It was compounded by the fact that a lot of this was "first time buyer" sales who didn't know the prices well.
Ammo was the same way, flying off the shelves. Gun makers scrambled to keep up, often times being bottle necked by the fact that one place made a part used by 20 other manufacturers. Ammo manufacturers ramped up as well.
Now for the most part things have settled down. The gun prices have returned down to earth, and while ammo is still more than it was a few years ago, it's price has basically returned to reasonable. While something might be difficult to find the day you want it, within a week or so you should be able to find what you want.
The exception seems to be rimfire .22lr. I haven't seen any on a shelf other than high end target ammo or over priced bulk stuff at a shop in over a year. Places like sporting good stores and walmart get their stock in in the morning and it's gone within the hour even with limits set on how much you can buy. One can easily turn around and flip it for 50-100% more than what you just paid. So part of the shortage is compounded by the fact that it is scarce and people will buy even if they don't need any - because, you know, it's scarce.