I don’t have an actual grammatical explanation. (Já and ainda are always confusing to me too! They have a lot of different meanings depending on the context.) But the way I think about it is that it’s similar to how in English we would say:
Did you already eat? Yes, I ate already. (already —> already)
Are you still studying? Yes, I am still studying. (still —> still)
When you’re saying yes, you use the same word.
But when you’re saying no, you have to throw some different words in there or it sounds weird:
Did you already eat? No, not yet (already —> yet)
(“No, not already” would sound a little weird.)
Are you still studying? No, not anymore. (still —> anymore)
(“No, not still” would sound a little weird.)
Is it true that you would always use the opposite adverb (já vs. ainda) when responding in the negative? Or only in this example? Maybe someone can confirm.
For me, it’s easier to think about these each as separate terms:
ainda = still
ainda não = not yet
já = already
já não = no longer/not anymore
…rather than thinking of each one as “ainda” + “não” = still not, etc.