Along with everything thats been said it takes to make a quality firearm
(parts, machining, materials, etc etc)
it also takes time and money for these new firearms to be developed. If a company sets out to make a new firearm. Whether it be completely designed from scratch or use core components and parts from other weapons it costs money to pay the designers/engineers. If it takes a year for 4 engineers to design a new weapon and they all make $100,000 a year...then that new firearm has to be set at a price to pay for all the design time, resources, testing, etc etc etc. Also the company has to make a profit
the true question is....how much are you willing to pay for the piece of mind that your weapon will fire when you need it. If you don't care then by all means go cheaper....but my weapon goes bang