The Istari were sent to "advise and persuade Men and Elves to good" and they were forbidden to fight Sauron directly. But apparently they are not forbidden to fight creatures which are not Sauron, with sword and "magic". Gandalf fights many times, e.g. on Weathertop, in Moria, at Helm's Deep, etc.
But he does not fight in the Battle of the Pelennor Fields: he goes to the Houses of Healing instead. At first I wondered why (NOTE: this is not my main question, as I explained in the comment. This is the background that brings to the question), then I answered myself that:
- Out-of-universe, Tolkien could not have his super death-cheating, now-white-and-more-powerful wizard do everything. The battle is the opportunity for more "ordinary" people to shine - Éowyn and Merry, for instance.
- In-universe, probably Gandalf thinks that in that particular situation he's more useful as a healer than in battle.
Then Merry, Éowyn and Faramir are brought to the Houses of Healing, Gandalf "tends" them (how? It's not specified, but the book says he "tends" all the ill people in the House), but he's apparently unable to heal them.
Only many hours later, when Ioreth mentions the old saying about king=healer, he goes to summon Aragorn to heal them.
And so the day passed, while the great battle outside went on with shifting hopes and strange tidings; and still Gandalf waited and watched and did not go forth (...)
Then an old wife, Ioreth, the eldest of the women who served in that house, looking on the fair face of Faramir, wept, for all the people loved him. And she said: 'Alas! if he should die. Would that there were kings in Gondor (...) For it is said in old lore: The hands of the king are the hands of a healer. And so the rightful king could ever be known.'
And Gandalf, who stood by, said: 'Men may long remember your words, Ioreth! For there is hope in them. Maybe a king has indeed returned to Gondor(...)'
Then Gandalf went out in haste, and already the fire in the sky was burning out (...)
Then Gandalf said: '(...) For it is only in the coming of Aragorn that any hope remains for the sick that lie in the House. Thus spake Ioreth, wise-woman of Gondor(...)'
It seems, to me, very strange that Gandalf the Wise, who deliberately avoided battle to heal people, needed a random hint from human lore to know what he had to do to save Meriadoc & Co. So I'm looking for possible explanations for this scene.
1) Gandalf did not know about athelas
Unlikely, IMHO. Elves know the healing virtues of athelas, Gandalf is friend with elves (his name means "Wand-elf" or something, even if he's no elf). Gandalf traveled with Aragorn for years before the events of LOTR. Furthermore, Aragorn used athelas to heal Frodo: ok, Gandalf wasn't there, but then they met in Rivendell, and it's reasonable to suppose that Aragorn told him about Frodo's wound and how he healed it. The Nine are the most dangerous foes after Sauron, it would be foolish for Aragorn not to share with the Company, or at least with his friend Gandalf, the medicine used against their dark power. (Or was Aragorn keeping his knowledge of athelas secret to use it one day to prove he's king? This, however, is very unlike Aragorn)
2) Gandalf knew about athelas, but needed Aragorn to use it
We know that you don't have to be a king to use athelas. If athelas is very effective when used by elves, it should be also effective when used by a Maia. I don't think he needs a mortal man, not even one with some drops of elvish and Maia blood like Aragorn.
3) Gandalf knew about athelas, but forgot about it
People forget stuff, it happens in RL, it happens even more in fiction, if the author wants so. But then usually the forgetting character acknowledges that he forgot, or another character rebukes him because he forgot - this doesn't happen to Gandalf.
Furthermore: he's no ordinary man, he's Gandalf! He's a Maia! How can he forget such an important thing? Some possible points for this theory, but I'm not fully buying them:
For an Istari, being incarnate "would imperil them, dimming their wisdom and knowledge, confusing them with fears, cares, and wearinesses coming from the flesh" (Source: Unfinished Tales). Objection: it seems to me a too generic and cheap justification.
He did not recognize the Palantir: Why didn't Gandalf know what the Palantir was?.
He did not recognize the One Ring. Objection: only Isildur had ever been so close to Sauron to see the Ring, so only the forgotten scroll by Isildur could tell Gandalf exactly what the Ring looked like.
In a previous chapter Gandalf seem to have forgotten his own name. Objection: he's probably still confused by his recent resurrection. But he remembers other stuff pretty well.
By the way: Pippin was also in the Houses of Healing, and Pippin was there when Aragorn used Athelas, did also Pippin forget?
4) Gandalf avoided using athelas on purpose
Out-of-universe, I think Tolkien wrote the events in this way to show that Aragorn is the real king. Like Odysseus and his feats with the bow. Common people recognize Aragorn as king because he's an healer. The hands of the king are the hands of a healer is a legend also in the real world, and maybe Tolkien was inspired by this legend.
But in-universe, did Gandalf do it on purpose? Did he avoid healing Merry, Éowyn and Faramir in order to show that Aragorn is the king? Did he wait so many hours, putting the lives of three good people at risk, to wait for Aragorn? Even if Gandalf had been manipulative in the past (dwarves and Bilbo, for instance), this seems too manipulative even for him, even if he had some "intuitional foreknowledge" that everything will be all right for these people.
Which of these scenarios is the correct one? Or is there a different explanation?
Answers from canon preferred.