I have written previously about trying the Mini 6 and going back to the Mini 5, buried in my post history somewhere. But if I had to buy one today, I would begrudgingly go 6. The Mini 5 I am currently using has been experiencing more RAM-related slowdowns in the last few months, so its functional life as a daily-use tablet is nearing the end if you care about speed. It’s not full-on slow yet, but you can tell its about one iOS update away from being there.
The actual answer is to wait until March for a likely Mini 7 refresh. That’s what I’m doing. But again, if buying today, it would be the 6, or it would be a very cheap 5 to hold me over until March.
Edit - found the comparison post here:
Post in thread 'Are you happy with the iPad mini 6?'
https://forums.macrumors.com/threads/are-you-happy-with-the-ipad-mini-6.2338369/post-31108596
great comparison in the linked post. I am really wondering what kind of "RAM-related slowdowns" are you referring to? Do you mean reloads of tabs and apps? Those are regular, just like the are on the iPad 9, but I have experienced zero slowdowns, the device is fast like in 2019, A12 is still a beast, definitely faster than my 10.5 pro, which is no slouch either, and very close to the 2018 iPad pro.
I have iPads with 2, 3, 4, 6 and 8 GB of RAM and while 3 GB reload more often than 4 GB, 4GB reloads pretty often too, so the difference is not huge. Between 4 and 6 GB instead it's night and day. My 6GB iPad pro reloads are much closer to my M1 pro than to the iPads with 4GB RAM. So personally I would not spend the money on a mini 6.
If I find a cellular Mini 6 at $200 (maybe I could stretch to $250 if in mint condition and with great batter health), then sure, but honestly I see those devices over double that price, which is waaay higher than what is worth coming from a mini 5. The mini 7 will have at least 6GB of RAM if it has A16, which is the minimum, so that would make it much better than the current mini and Apple is rumored to be correcting the Jelly Scroll issue. Not much more unfortunately, I would love to see promotion on the mini 7, but that's not happening...
As for OS updates, the mini 5 should get at least a couple of years more, but I don't care about OS updates and even less about security, that's a iPad not a Windows laptop, it's virtually impossible to get malware without social engineering or someone having physical access to your device. And it takes another couple of years after end of support before some apps cannot be updated or installed. So the mini 5 should be fine for at least 5 years and probably more.