Uhhhhhh, that’s complicated. Technically grinding has whatever depth the base game has, just players intentionally repeat one part that they know they can beat.
The problem of grinding is more one of human psychology. We try to find the fastest lowest effort way of getting the results we want, even if it makes us bored.
I’d say the solution is to minimize or prevent grinding, force the player to move between content in order to improve. Otherwise they’ll stake out the one place with the highest EXP return and closest to whatever respawns the monsters. This can be done by having monsters refuse to drop EXP after being killed a certain number of times, forcing you to move on, by adding points of no return, by making encounters not respawn, etc.
Alternative solutions would be to speed grinding up by offering choices in how to grind. Actually, TWEWY is a great example here. TWEWY’s random encounters are opt-in, so you never get encounters by accident and you don’t need to go running around in a field until one pops up on you. The cool thing about them is also that you can chain the encounters for bigger rewards, so you can chain up to like 10 battles in a row, which you need to beat without healing.
So the idea is, allow players who want to grind to get access to battles instantly, and give them the option of facing something super hard to get a ton of EXP in one go.
People want to get to the end result, you might as well give it to them quick, but don’t give it to them for free or you’re writing them a blank check to wreck the game balance.
As for actual ways to vary grinding, you can have things like EV training in pokemon, which was trivialized in later games with good reason in my opinion. In Tales of Symphonia, every character has a Technical vs Strike meter that changes based on their equipped EX-Skills through combat, and grants access to different moves.