BikeGuy321 wrote:
Yeah, some of the higher spec parts cost more because they are light weight, but they dont always work way better, they just weight less.
In my experience, what most of the higher-end MTB components also offer are a bit more durability than the lower-end stuff, in addition to a performance (or weight) advantage. I will admit, however, to having not ridden many of the newer MTB components. This is more based on when I was working at Mountain Biking magazine (very early days stuff), and later at Specialized. 
As for the topic, comparing the cost of any high-end MTB (electric-powered or otherwise) against MX bikes is an exercise in crazy-making. How can a mountain bike cost as much as an MX bike? There's no engine. In fact, you are the engine. Personally, I think it has as much to do with how they're constructed (and what they're constructed from) as anything else. Spec an MTB, and you're going catalog shopping from a variety of vendors (Shimano, Sram, Fox, Rock Shox, etc.), and there's probably less of the actual construction being done by the companies themselves...even if they're bringing their own chassis design.
For MTBs, you definitely pay a premium for light weight, whether it's a carbon chassis, lightweight wheels, or other components. You're also not going to huck something as big as you would on an MX bike (unless you're maybe a world-class downhiller). I think things like wheels also get a bit more attention during the build phase. Most of the spokes on MTBs I've owned had never required much in the way of post-purchase attention. And someday I'd love to see wheels on an MX bike that didn't have as much brake and chain drag as you get on an MX bike.
On the other hand, if I had a mountain bike that featured some of the welds I've seen on MX bikes, I'd be pretty bummed. Sometimes they look good. Other times? Not so much.