How is this subjunctive?
De tous les souverains Français, Henry IV restera le plus populaire, le seul roi dont le peuple ait gardé la mémoire.
Why is this sentence subjunctive?
One place you will see the subjunctive mood in French is after a superlative, especially where it is describing an opinion, rather than a fact; however, some French speakers even use it then, when a factual statement is intended.
Example: C'est le plus beau chat que j'aie vu hier.
This is the most beautiful cat that I saw yesterday.
In your example, Henry IV will remain the most popular king, the "only one" that the people (wanted to) remember, actually remembered.
Saying that someone is the only one to be liked so much is an opinion. It would be seem more factual to say, for example, that "some other King X was the only one to have 6 (legal) wives."
But perhaps there is some doubt when we say things like "the only one", even in what is trying to be a factual statement, because we realize we don't necessarily know of every person who might fit into a category: "He was the only cyclist who cheated this season." (So far as we know).
Maybe this is why some French speakers are said to use the subjunctive in all superlative statements, and some only in opinionated comments.
I'd translate that as, more or less, "of all the Frech sovereigns, Henry the fourth remains the most popular, the sole king whose memory the people have kept."
I guess it is the conjugation of the word "avoir" (have) here that confounds. According to French Verb Drills by R. de Roussy de Sales, the subjunctive mood is so called because "it is usually found in a subjoined or subordinate clause." He then goes on to give a number of examples, citing conjunctions which generally trigger the use of the subjunctive mood. "Dont" is not among them, but I assume that it does introduce a subordinate clause here.
One thing to keep in mind is that the subjunctive mood is not used in French as often or in the same way that it is used in Spanish. I see that you also study Spanish which is why I mention this. In Spanish, you can hardly get through a one-minute conversation without having to encounter subjunctive-mood verbs. That is not the case in French. As far as I can tell, in french the subjunctive mostly is associated with uncertainty, subjectivity, doubt, or relativity in the mind of the speaker. Perhaps the speaker here recognizes the subjectivism of his or her analysis with regard to Henry IV. This does not seem to be uncommon among French literary and historical criticisms. Here's a quote from an analysis of Molière: "Quant aux chefs-d'œuvre poétiques, le seul dont il ait alors aimé à constater le succès, fut son Ovide en belle humeur..." That was published in 1889, more than two hundred years after Molière died, so the writer clearly has no irrefutable way of knowing what Molière liked and didn't like.
I guess in theory the subjunctive in any language works the same way. If I were you, I would go. (In Spanish and French you would use a subjunctive in the first clause of that sentence and a conditional in the second, just as in English). But I hear Spanish speakers using the subjunctive mood frequently, in situations where the French don't. Compare:
que tengas un buen dia vs bonne journée
espero que le vaya bien vs j'espère que vous allez bien
Aunque sepa usted los riesgos... vs Même si vous connaissez les risques...
(This last example also nicely demonstrates that connaitre and savoir do now always translate as conocer and saber. It is often the case that they do, but it's not a one-to-one function and once in a while the spanish use conocer where the french use savoir, or vice-versa.)
This is my impression. I may be mistaken.
What a very formal and literary phrase - not one you will hear in general conversation but may read in a serious history book.
I believe the clue lies in the use of the future tense to suggest that Henri IV will remain the most popular king. This introduces an element of doubt (perhaps some yet undiscovered fact will be unearthed to undermine that opinion) hence the use of the subjunctive following the coordinating conjunction «dont ».
With multiple phrases there has to be one "principale" and one "subjonctif".
In the sentence given, the principal phrase must be: «De tous les souverains Français, Henry IV restera le plus populaire». The topic/subject is clearly "Henry IV and it stands alone quite nicely.
The other phrase «le seul roi dont le peuple ait gardé la mémoire» may need a slight tweak, as "la mémoire" might be better as "his memory"/«sa mémoire».
The second serves the first. It adds-to or completes the first. By itself it doesn't mean anything.
When there are two or more phrases one is the principal but the other(s) can be either subordinate, not subjunctive, or coordinate. I am not aware that there is a specific requirement for a subjunctive in all second phrases.
I also think that «la mémoire » is correct - I believe that using «sa mémoire » means that the people are remembering what he remembered whereas «la mémoire » refers to their collective memory of him