In the books, it was Glorfindel who saved Frodo from the Nazguls. Obviously, I'm talking about the movies, particularly the reason why Peter Jackson changed this scene from the book. Why did PJ replace Glorfindel with Arwen? Why did Peter Jackson remove Glorfindel from the motion picture trilogy?
Because roles needed consolidation
There are way too many characters in the Lord of the Rings books to properly cover them all in movie form. Just as scenes are often cut for time (most extra details in scenes), plot structure (scouring of the shire), or irrelevance to the core narrative (Tom Bombadil), so too are characters of minor roles often cut or merged (credit to Valorum). This saves time on introducing trivial one-off characters you'll never see again, as well as giving the ones who do end up filling the role more prominence. In the 1978 animated movie for example, they apparently gave the role to Legolas instead.
But why give it to Arwen specifically?
Lord of the Rings doesn't exactly have a whole lot of notable female characters. Galadriel, Arwen, and Eowyn are basically it, and their presence is already scarce. Giving more screen time to these characters, even in small ways, gives them greater relevance to the plot overall, and allows for additional opportunities to introduce and explore side plots (such as her and Aragorn's relationship). Glorfindel doesn't fill any gaps in character relation to the audience, so Arwen was the clear choice.
In a quote from Philippa Boyens, one of the screenplay writers for the trilogy:
Because Galadriel is an incredible force - she's about the power inherent in women - it wasn't necessary to find more for her to do in the film. But Arwen is a vital part of Aragorn's story, and we tried many permutations of how to bring her into it more, drawing a lot on Luthien and Beren [the Elf and mortal man whose tragic love is a prototype for that of Aragorn and Arwen]. But as the story's come on, and Liv has so beautifully inhabited Arwen, she has found her own level.
Tolkien admitted he had a weakness when it came to writing characters who were women. With the exception of Galadriel, who is a central female character, there are no other important female characters in "the Lord of the Rings" or "the Hobbit". Glorfindel is very like Legolas, an elven lord and so I could see why he would be a good candidate for replacement with a female character that needed further development.
By making Arwen more central, and more action based, it evened out this lack of female characters. It also fleshed out the House of Elrond more, as she is his daughter. It also allowed for a longer introduction and allowed us to care more about the love of Aragorn and Arwen.
One of the really beautiful stories in the Silmarillion is "Beren and Luthien" the story of a man and an elf who fall in love. Tolkien actually dedicated this story to his wife. By including Arwen more, for me anyway, it invoked that love story which was very close to Tolkien's heart. It's one of the creative decisions Mr Jackson made that I really approve of.
Different times! When the book was written less than 20 years had passed since women got the vote. When the film was made Britain had already had a female Prime Minister. I don't think there's any other reason. The question is whether or not that justifies the tampering; that's for individuals to decide for themselves.
The other difference was that in the book it was Gandalf who brought down the tidal wave with white horses on the riders, not Arwen. This additional departure from the book seems to support the idea that there was an agenda to beef up a female part.
Regardless of one's stance on poetic license in the interests of adapting to the times, to me it was a great shame how he messed with the story telling. In the book the drama of that scene is one of the most exciting moments in the trilogy imho. Walking along, and then suddenly "Flee! The enemy is upon us!" (from Glorfindel who has picked up the black riders' approach with his super-acute elven senses). The resulting chase is excellent too, with half the riders behind Frodo and the other half bursting from the tree line to his front left in an attempt to cut him off. When Frodo becomes entranced by the witch king and is slipping further into the wraith realm he also sees Glorfindel striding towards the black riders, shining like some kind of avenging angel and fully intending to take them on. Pretty gripping stuff. They should have made Arwen equally bad ass!
In his A Vision of Middle-earth: Contemporary views in Peter Jackson’s Lord of the Rings trilogy, David Goldie refers to Shippey arguing that
Gender politics being substantially different now than at the time of Tolkien's writing, Shippey consigns this incident [replacing Glorfindel with Arwen] in particular to the level of “playing to the gallery”. However in conjunction with the other instances previously mentioned, it seems clear that Arwen's enhanced role is more than simply symbolic. Despite this, the increased presence and participation of the female characters is perhaps even more remarkable with Éowyn.
The previously mentioned instances list other interesting and sometimes subtle changes, re Arwen, to the book material in the script, arguing (in my reading) that the script simply corrects the story in those aspects where it is found wanting. So the why as to replacing Glorfindel with Arwen would be a part of this larger pattern.
In addition, as a purely personal opinion, I think Glorfindel is a difficult character to include in a movie, especially in a cameo appearance. He is arguably a very powerful figure (discussed here) and would require an actor with an eminent screen presence, yet his role would be in fact very small; a clear dilemma, so Glorfindel had to go.
I suspect the main reasons are the ones already covered by other answers: in adapting a complex book to film it's often desirable to simplify things by merging characters, and clearly the makers wanted to boost Arwen's on-screen presence. It's not the only place where they beefed up her role.
But there's another factor here. Of all the changes that were made in the film adaptation, removing Glorfindel is the only one that we know Tolkien would have supported, because he acknowledged Glorfindel should never have been there in the first place.
Per Wiki, cited to The Return of the Shadow:
Christopher Tolkien states that some time after the publication of The Lord of the Rings, his father "gave a great deal of thought to the matter of Glorfindel" in the book, and decided that it was a "somewhat random use" of a name from The Silmarillion that would probably have been changed, had it been noticed sooner.
Why was Glorfindel a bad choice? Because he'd already died several thousand years before LotR. Based on sources like this, my best summary of the backstory:
- In early material that eventually became part of The Silmarillion, Tolkien wrote about the fall of Gondolin. At this time, Tolkien conceived of Balrogs as fearsome monsters, but not nearly as fearsome as they would later become - think something around the power of a cave troll.
- In that story, a large force including several Balrogs attacks the city, and an elf named Glorfindel defends fleeing citizens against a Balrog. Eventually he kills the Balrog, but as it falls from the cliff it grabs him and pulls him to his death. (Hmm. Maybe Gandalf should've paid attention to that story.)
- Several decades later, while writing the early parts of LotR, Tolkien needed an elf to save the hobbits. He recycled the name Glorfindel, possibly intending this character to be a descendant of the Balrog-slayer of Gondolin.
- Along the way, Tolkien's conception of Balrogs shifted, and they became the demigod-level beings that we're familiar with from Moria.
- Hence, original-Glorfindel's achievement of slaying a Balrog retroactively became much more heroic and unusual than when Tolkien wrote it.
- This, in turn, meant that it no longer made sense for LotR-Glorfindel to be a namesake, because his deeds were so impressive that nobody would ever reuse that name.
- Hence, JRRT decided that LotR-Glorfindel and Silmarillion-Glorfindel had to be one and the same, despite that inconvenient "being very dead" issue.
- He resolved this by declaring that Glorfindel had been sent back to Middle-Earth by the Valar.
This isn't entirely without precedent. Beren, Luthien, and Gandalf were all allowed to return to Middle-Earth after death. But those stories were planned, and Tolkien did a lot of work to sell them to his readers. In contrast, Glorfindel's resurrection is an ad-hoc and unsatisfying retcon, almost literally deus ex machina. I don't think it's even explained in either LotR or Silmarillion, unless they inserted something in later editions.
So if you're going to change anything at all from the book as published, this is probably the most justifiable change. We have Word Of Author that it was, essentially, a goof.