There are some brands of bicycles that can cost more than the down payment on a car. Why? Surely making a bike lightweight and reliable isn’t so difficult that it warrants that price? Is it just the brand name or maybe it has to do with customization options?
Mountain bikes have to be lightweight and strong, and production volume is low. Suspension design takes R&D, and adds moving parts. Start pricing components and you hit $5000 easy for a full-suspension bike. For hardtails, you are making a lot of compromises at $1500, but $2500 gets you a nice bike.
For road/gravel bikes, once you get over $2000, you are paying a lot of money for tiny weight savings, negligible aerodynamic improvements, and electronic gizmos.
For either mountain or road, if you want a custom/hand-made frame and parts made in the developed world paying living wages, you are going to spend a lot more. Taiwan makes a lot of great frames, but if you want a frame made buy a dude in Denver who names all his bikes after craft beers, add several grand.
For city/commuter bikes, you can get something perfectly good for under $1000, but if you can swing $2000, get a Brompton.