Etymology

Eärendil is a Quenya name, meaning 'Lover of the Sea'. However, Tolkien created the name based on Old English literature. Tolkien himself states (Letters, 297) that the name is derived from Anglo-Saxonéarendel. He says that he was struck by the "great beauty" of the name as early as 1913, which he perceived as

entirely coherent with the normal style of A-S, but euphonic to a peculiar degree in that pleasing but not 'delectable' language.

There is a poem by Tolkien dated to 1914 entitled The Voyage of Eärendel the Evening Star (published in The Book of Lost Tales 2 267–269). Tolkien was also aware of the name's Germanic cognates (Old NorseAurvandill, LombardicAuriwandalo), and the question why the Anglo-Saxon one rather than the Lombardic or Proto-Germanic form should be taken up in the mythology is alluded to in The Notion Club Papers. The Old Norse together with the Anglo-Saxon evidence point to an astronomical myth, the name referring to a star, or a group of stars, and the Anglo-Saxon in particular points to the morning star as the herald of the rising Sun (in Crist Christianized to refer to John the Baptist).

Tolkien was particularly inspired by the lines in Crist,

éala éarendel engla beorhtast / ofer middangeard monnum sended

"Hail Earendel, brightest of angels, sent over Middle-earth to men."

which can be taken as the inspiration not only for the role of Eärendil in Tolkien's work, but also for the term Middle-earth (translating Middangeard) for the inhabitable lands (c.f. Midgard).

The first line is paralleled by Frodo's exclamation in Cirith Ungol, Aiya Eärendil Elenion Ancalima! which is Quenya, and translates to "Hail Eärendil, brightest of stars!" Frodo's exclamation was in reference to the 'Star-glass' he carried, which contained the light of Eärendil's star, the Silmaril.

Biography

The son of Tuor and Idril daughter of Turgon, Eärendil was raised as a child in Gondolin. When Eärendil was seven years old, he escaped the sacking of Gondolin with his parents, living afterwards in Arvernien by the mouth of Sirion. Eärendil later became the leader of the people who lived there, and married Elwing, daughter of Dior the son of Beren and Lúthien. They had two sons, Elrond and Elros.

With the aid of Círdan the Shipwright, Eärendil built a ship, Vingilótë (or Vingilot), which is Quenya for foam-flower. He sailed this often around the seas west of Middle-earth, leaving his wife behind in Arvernien. At this time Elwing had in her possession the Silmaril that Beren had wrested from Morgoth. News of this came to the sons of Fëanor that were still living, and they attacked the people living in Arvernien, and slew most of them. But Elwing, rather than be captured, threw herself with the Silmaril into the sea. The Silmaril was not lost, however. According to The Silmarillion:

For Ulmo bore up Elwing out of the waves, and he gave her the likeness of a great white bird, and upon her breast there shone as a star the Silmaril, as she flew over the water to seek Eärendil her beloved. On a time of night Eärendil at the helm of his ship saw her come towards him, as a white cloud exceeding swift beneath the moon, as a star over the sea moving in strange courses, a pale flame on wings of storm. And it is sung that she fell from the air upon the timbers of Vingilot, in a swoon, nigh unto death for the urgency of her speed, and Eärendil took her to his bosom; but in the morning with marvelling eyes he beheld his wife in her own form beside him with her hair upon his face, and she slept.

Hearing of the tragedy that had befallen in Arvernien, Eärendil then sought after Valinor, and he and Elwing found their way there at last. Eärendil thus became the first of all mortals to set foot in Valinor. Eärendil then went before the Valar, and asked them for aid for Men and Elves in Middle-earth, to fight against Morgoth; and the Valar accepted his plea.

Because Eärendil had undertaken this errand on behalf of Men and Elves, and not for his own sake, Manwë forbore to deal out the punishment of death that was due; and because both Eärendil and Elwing were descended from a union of Elves and Men, Manwë granted to them and their sons the gift to choose to which race they would be joined (a gift that was further passed to the children of Elrond, who became known as the Half-elven). Elwing chose to be one of the Elves. Eärendil would have rather been one of the Men; however, for the sake of his wife, he chose to be one of the Elves.
The Silmarillion says this:

Now when first Vingilot was set to sail in the seas of heaven, it rose unlooked for, glittering and bright; and the people of Middle-earth beheld it from afar and wondered, and they took it for a sign, and called it Gil-Estel, the Star of High Hope.

The Valar, having listened to Eärendil's plea, went with a mighty host to Middle-earth, and overthrew Morgoth, and bound him. Eärendil took part in the battle, riding on Vingilot beside Thorondor and the Eagles. It was his blow that slew the great dragonAncalagon and cast it down onto Thangorodrim, the event which, along with the sheer devastation caused by the War of Wrath, led to the Ruin of Beleriand.

Eärendil sails the heavens, guarding the Door of Night through which Morgoth had been cast. He wears upon his brow the shining Silmaril, visible from the Earth as a bright star (commonly taken to be Venus).