During the War of the Ring, when Gandalf the Grey is imprisoned by Saruman the White on the pinnacle of Orthanc, with no possible escape, during the night, The Moth appears and when it flies close to Gandalf he grabs it and whispers to The Moth, whom he asks to find and contact Gwaihir, one of the Eagles, that he needs help. The Moth flies away, and shortly thereafter Gwaihir rescues Gandalf. Months later, the same Moth is also seen during the Battle of the Morannon, flying around Gandalf to advise him that the Eagles are coming, exactly at the same time on which the Nazgûl are to attack Gondor's and Rohan's armies in the battle mounted on their flying fell beasts. The Moth is believed to be an Antheraea polyphemus.
The Moth doesn't appear in the book, although it is possible that it indirectly appears, as Radagast the Brown says to Gandalf in The Fellowship of the Ring that he would send any messengers for help. Many believe that The Moth was inserted in the movie as a tribute to Radagast, who doesn't appear. Many argue that The Moth may be a messenger of Radagast or even Radagast himself.