One aspect that drives cost is that high precision circuits often need a few parts that have tighter tolerances than the typical 5% or 1% that are usually good enough for 99% of use cases. And these parts are a lot more expensive.
It's worth mentioning that often parts aren't manufactured to be high precision variants. That would be extremely expensive. What happens instead is the parts get measured and "binned" by how close to spec they are. In a large enough sample, statistically a few parts (even with an inaccurate process) will be perfect. The best ones are sold as A grade, etc.
This is pretty common for thinfs like resistors, but even CPUs and RAM are binned by their overclock performance as there's some randomness in production.
When I were a wee lad, we used to machine passive components to value (sometimes the "whole thing", sometimes a companion trim piece). There's no economy of scale to be had there, and binning won't help all that much because it's the installed value that matters, not the loose part value.