There’s no reason to.
Your OS vendor (Ubuntu or whatever) will maintain the version you have throughout the life of the distribution, including backporting security patches, if needed, which is great for longterm stability and compatibility. When you upgrade across major versions of MariaDB, MySQL, or Postgresql, it is often best practice to perform a dump and restore (though check the upgrade docs for your specific versions of your specific database), which is a time-consuming process that requires downtime. Those are best planned as part of an OS upgrade for the vast majority of users. There may be other changes that require code changes in your applications, again check the upgrade docs for your specific versions of your specific database.
If you install a different version of Mariadb from the one provided by your distro, you do not get the long-term update assurance, and you’re then on the hook to always upgrade from that new source…meaning you may be signing up for more frequent dump/restore cycles (Mariadb doesn’t change major versions extremely often, and they maintain a couple of major versions via a long term support model, so it’s not a super big deal in this case, but it can happen).
There is no benefit to going off-roading for most users most of the time. The path of least pain for almost everyone (including most experts!) is to pick a distribution you like made by people you trust, use the latest version available, and use exactly the packages they provide for you. Your applications, custom code, and specific scaling issues are more than enough problems for most people, why make more problems for yourself?
Databases move slowly, and applications trail behind the latest features by a year or two, at least. You’re really not missing anything by being on a major version of Mariadb that’s a year or two old.
And, finally, for OP: We do not provide any of these packages (Mariadb, Apache, nginx, Postfix, SpamAssassin, etc.). Your OS does. If you want new packages, pick a new OS. If you’re thinking about spending a bunch of time deploying a custom Mariadb version from upstream, I would suggest you spend that time planning a migration to Ubuntu 24.04. It’s not a lot more time, and you get all new packages, not just Mariadb, and you aren’t going off on your own making more problems for yourself.