Who Makes A Grandmother Prouder? A Mamzer or a Kohen Gadol?

...ממזר פוסל ומאכיל.כיצד, בת ישראל לכהן, ובת כהן לישראל, וילדה הימנו בת, והלכה הבת ונשאת לעבד, או לגוי, וילדה הימנו בן, הרי זה ממזר היתה אם אמו בת ישראל לכהן, תאכל בתרומה.בת כהן לישראל, לא תאכל בתרומה.

.... A mamzer (bastard, illegitimate child) deprives a woman from eating terumah, and also bestows the privilege on her? How so? If an Israelite's daughter was married to a kohen, or a kohen's daughter was married to an Israelite, and she bore him a daughter, and the daughter married a slave or idolater, and had a son by him, the son is a mamzer. If his maternal grandmother was a bat yisrael (daughter of an Israelite) married to a kohen, she may eat terumah. But if she was a kohen's daughter married to an Israelite, she may not eat terumah.

(ו) כהן גדול פעמים שהוא פסל.כיצד, בת כהן לישראל, וילדה הימנו בת, והלכה הבת ונסת לכהן, וילדה הימנו בן, הרי זה ראוי להיות כהן גדול עמד ומשמש על גבי המזבח, מאכיל את אמו ופוסל את אם אמו, וזאת אומרת, לא כבני כהן גדול, שהוא פוסלני מן התרומה.

(6) A high-priest may occasionally disqualify [his grandmother to eat of the heave], as in the following instance:—when a priest's daughter was married to an Israelite, and bore him a daughter, which daughter married a priest, and had a son by him,—that son will be qualified to be a high-priest, and to minister as such at the altar; he qualifies his mother [at the death of his father] to eat of the heave, but disqualifies his maternal grandmother, who may well pray that "there be not many in Israel like my grandson the high-priest, who disqualifies me from eating of the heave-offering."

The Grandmother in 7:5: Her grandson, even though he is a mamzer, is her living descendant by a Kohen. Thus, he enables her to eat Terumah.

The Grandmother in 7:6: Her grandson is her living descendant by an Israelite. Thus, he cannot qualify her to eat Terumah. However, since the grandson is also the son of a Kohen, and he is eligible to become the Kohen Gadol,

Aruch Laner: When the events in 7:6 occur AFTER the events in 7:5 to the same woman, the grandmother's marriage to the Israelite, combined with her resulting 7:6 descendants, prevents her from eating the Terumah that her 7:5 grandson permits. As long as any of those 7:6 descendants remains alive, even if he is the Kohen Gadol, she is not permitted to eat Terumah theoretically permitted by her 7:5 grandson.