For mountain biking, I use Pearl Izumi Men's Liner Shorts and then buy cheapo cargo shorts from Target or WallyWorld or TJ Maxx. This has been the perfect solution for me.
I like this system so much that I even started using the liners and cargo shorts on my road and gravel bike rides.
I am a firm believer that one can never have too many pockets for storing snacks, spare tubes etc. .....and cargo shorts are perfect for carrying, well, cargo.
I do have two or three pairs of (expensive) mountain bike specific shorts....but they are sitting on the floor of my closet collecting dust. I have found they generally have too few pockets and are usually far too baggy for my needs.
FWIW