But I'm not sure that hit points are amazing, since their primary purpose is counting damage down from a maximum (full health number), to zero.
Hit points are amazing, and that's not their primary purpose. Hit points survive because what they do is make encounter design more predictable. Let's look at a game like Slay the Spire which has hit points and classes but not levels. Both hit points and classes here are the core mechanic not only for measuring the skill of play, but also for allowing the designer to manage the balance of the game in such a way that he can control the challenge and play test the game.
This works well because of the hit points ablative nature. Game play doesn't change until you run out of hit points. (With a very few exceptions, like there is a relic/feat that gives you a bonus to damage if you are below half health, and another that gives you a bonus to healing if you are below half health, but note that's anti-realistic. There is no death spiral here.) Packetizing the penalties in the game to something like hit points let you tweak the challenge each round* of combat represents. Indeed, the core mechanic of the game is you usually know ahead of time exactly how much protection you need because of how much damage you are facing and have to manage your turn accordingly. Deep strategy involves sacrificing hit points as a resource now to gain advantage later, either killing the enemy earlier (many of them scale in power over time) or spending resources to scale up in power yourself. But you have to horde hit points as well, because you lose when you run out.
You can't do that sort of design with a "realistic" wound system where you might randomly take a "head shot" and be instantly killed from any hit. That's why you don't see game designers implementing wound track systems very often because it leads to random deaths where you take control away from the player. What hit points give the player is control. In fact in RPG terms they are quantitized plot protection. You have the ability to shrug off hits and keeping going until you run out. And because the number of hits you can take is predictable and because your performance over time is usually predictable, it's easy to design a challenge or series of challenges in such a way that the player is slightly advantage and can maximize or lose that advantage through thoughtful or thoughtless play. And then because hit points mitigate against bad luck, it's a lot easier to play test your assumptions that it would be with any other system. And players enjoy it because they feel in control and can make thoughtful decisions in a way that you can't if every single attack threatens any possible result.
(*Turn based!)
Classses are the same thing. They allow the designer to control what's possible. This makes play testing a lot easier than if players could mix and match and create anything they wanted. You'd have to test all sorts of things to find out if there was some combination with unexpected emergent properties. Classes limit choices down to something designers can manage, while at the same time doing other things like forcing players to go broad rather than deep. You can predict better that a player will have no more than X at a given time, while having at least this much Y. And again, this makes encounter design so much easier compared with freeform systems. It also makes resource creation a lot easier if you are like a video game maker who has to create models and images and intellectual property if you have constraints on what the player is playing.
But I'm not sure that classes are amazing, because why does D&D need so many of them, with sub-classes, prestige classes, NPC classes, dual-classes, and multi-classes? With so many options, wouldn't features a la carte be better?
Would it? I mean this can lead into questions of what the tradeoffs are, and what objectively makes a class design good or bad, but the fact that classes can be designed badly doesn't prove that they are a bad mechanic.
I guess we'll agree that levels are good, solid, organic design.
They aren't always necessary though. Levels accomplish a purpose. In Slay the Spire you have classes but not levels. Character advancement is accomplished in different ways. Similarly, Vampire Survivor has classes and levels to manage the tactical level play of the game, but at the strategic level advancement of the player is managed in a more freeform manner by allowing you to buy the boons you want with a separate metacurrency.