Grammarly grammar checking predates modern LLMs by many years, so I assume they’re actually using some kind of rule-based engine internally.
It worked extremely well, as you say I think by using basic rules engines.
I’ve canceled my subscription recently as found it getting worse, not better, I suspect because they are now applying LLMs.
The suggestions started to make less sense and the problem with LLM suggestions is all your writing takes the tone of the LLM, you loose your personality/style in what you write.
The basic rules approach worked much better for me.