I'm into mountain biking and it's fucking criminal what they charge for bike prices these days. A good bike with decent quality components is like $5000-$7000. High end name brand components will bring that up to $9000 easily. Higher end frames and boutique components can bring it into the $11000-$15000 range. It's fucked lol.
Oh and for an electric bike add $2000-3000 to the price.
Your notion of "decent" is certainly not the same as 99.99% of the population. Or you live in a very expensive place and have a very specific use of mountain bikes.
Yes my notion of "decent" is skewed because I'm doing 3000 foot climbs/descents on highly technical and fast trails with drops, jumps, rock rolls, wet roots, etc. You can ride those on a $500 Walmart bike but you might not survive it lol. There's deals to be had, direct to consumer bike brands are considerably cheaper (like $1000 cheaper in general I'd say) and there's obviously more budget oriented options, but their performance, longevity, and weight are typically not as good.
I was going off of a ballpark average of what I've been seeing in media and bike shops over the last couple of years. Seems like every mountain bike even with lower end components is $5k+ these days, but media tends not to cover cheaper stuff because it's not as interesting.