The costs have to reflect R&D, manufacturing plants and tooling, materials and labour, transport, and of course profit for the manufacturer, distributor, and retailer.
The biggest factor in price, however, is the volume produced. The very high fixed costs of R&D and Manufacturing (in prooportion to the rest) have to be spread across the volume produced and sold. The fewer made the higher the cost.
The second biggest factor in price is probably competition, and once you have bought your camera, you are largely tied to that brand's lenses or about 2 other makes and you can rarely buy indentical or near identical lenses from more than one company. With less competition, there is less pressure on prices - conversely witness how computer prices have come down as the number of makers increased. and component producers consolidated
The third biggest factor is desirability i.e. how much does the buyer want the goods. The more desirable the product, the higher the price and lesser the competiton. Apple iPhones are good examples of this factor. Short supply can also increase this.
The final factor is brand which often goes together with desirablity. The stronger the brand, the higher the premium. For example a BMW 3 Series and Skoda Superb may cost similar to build, but the BMW costs much more to buy, particularly when specification is taken into account.