Diapers fall under a category caled "demand inelastic," meaning, as Hypnotized said, that people will have to buy them, just like bread, milk, and gasoline. The only dmenad that matters is the number of people needing diapers, a number that is very steady over time.
The retail price of diapers is not determined by supply and demand; supply and demand determines the price of commodities, ie oil, gold, lumber. In theory, this means that changes in the price of commodities that are used to produce diapers will result in changes in the price of diapers. However, finished products are rarely so responsive to changes in commodity prices. Instead, companies "mark-up" a product, selling it for a certain percentage above the cost of manufacturing and distributing the product. Electronics, for instance, sell at a standard one hundred percent, or double, the actual cost of the product.
So how do companies set the retail price? They calculate the expected value of the finished product (the average manufacturing and distributing price of their product), and then gather data correlated, and theoretically related to cause as well, with what a family is willing to pay. This is just like a linear regession equation, but is slightly more complicated. It is called maximum likelihood estimation. Just like what it sounds like, this is a statistical technique used to estimate, in this case, the maximum price that a customer will pay for diapers. What helps companies predict that price? Income of the targeted market, disposable income, number of children, how many diapers they bought last year, how many they think a child should/would go through in a day, etc. There could be one hundred variables and five thousand observations for each one, all entering a single equation by way of linear algebra. The goal of such research is to find out what the maximum price someone would pay for diapers is, then the companies must set their price somewhere near that number. Why are pampers more expensive than generic? Because of marketing. Not because marketing adds cost to the product, but because the people at Proctor and Gamble, who make pampers, know that with a slightly better product and much better marketing (targeted product development, advertising) will induce people pay the few extra dollars. This maximum price is translated into a basic mark-up percentage.
Why then, when the price of making a diaper flucuates with the economy and the commodities markets, do diaper prices not swing with them? Because people don't care about recessions (which are not the cause of increased diaper prices; the U.S. is experiencing low inflation at the moment) or rising commodity prices. The maximum price they said they pay in that maximum likelihood equation is very steady. Companies swallow the decreased profit margin for a time. A firm will stay in business so long as they cover their costs; any profit, whether fifty percent from a fifty percent mark-up or a forty percent from an increased manufacturing cost and a steady retail price, it's all profit. Only when the base price of a product increases permanently or when adjusting for inflation will companies raise the retail price in accordance with a newly calculated maximum price. Typically, given the expense of market research, companies won't even bother recalculating the maximum retail price until their costs rise significantly or fewer of their products are being sold.
What does all this mean? Companies sell their product for as much as they can convince you to pay for it. They'll try harder to convince you when their own prices rise permanently, but otherwise, what you pay stays steady. It sucks to be on the bottom end of the capitalist food chain, but there it is. So why are diapers so expensive? Because companies know you will pay it. Even the fact that, for most people, a diaper is a necessity is a factor calculated into the price, and it raises that price.