The M2 Mac mini's RAM is integrated into the SoC package, which has some advantages (good memory bandwidth, no copying between CPU and GPU RAM) and disadvantages (expensive, non-upgradable DRAM tiers.) Internal flash storage is basically non-upgradable as well (though you can easily plug in external thunderbolt m.2 storage.)
It also doesn't currently run Windows natively, nor does it support eGPUs.
I'm not sure any Mac mini model was ever much of a competitor to cheaper PCs, but mini PCs have gotten a lot better over time, probably inspired somewhat by the Mac mini, while the mini has followed in the footsteps of other Mac models by adopting Apple Silicon and unified memory.
The mini is a perfectly decent Apple Silicon Mac, and compares favorably with the older intel Mac minis in terms of performance, but I'd spring for 16GB of RAM (at least) for my use cases.