The actual production cost of a piece of computer hardware is much cheaper then what you pay for it. You pay for the 'time', (research, design, development), put into creating the piece of hardware. So overtime as the design becomes obsolete, they can significantly lower the prices of it and still make a profit.
For example a processor that cost you $300+ probably doesn't cost even $100 for the manufacturing and assembly of the materials inside of it. Meaning overtime the manufacturer can significantly lower the cost and still make a profit.