If you ask someone to name "the mirror" of a book's protagonist, most will say the villain. But not every story is so black and white (or even follow the Hero's Journey arc, for that matter).
Foil Characters come in all shapes and sizes. They may be the rival in your story OR your protagonist’s best friend! Let’s talk about what makes a Foil Character and why they aren’t always an oppositional force to the main character, but an enhancing one.
A "Foil Character" is a type of character featured in a story, and a literary device: they act as a distorted mirror ("foil"), to contrast and explore the protagonist’s inner workings. The intentional implementation of a Foil Character as a literary device is to juxtapose the main character, highlighting their attributes by providing contrast through their own thoughts (values, dogma), personality (traits, identity), or actions (practice, lifestyle).
Foil Characters are not inherently opposite to protagonists. They can reflect aspects of the main character in some ways and differ in others. Foil Characters are not one-size-fits-all—they are as unique and varied as the main characters they mirror. Foil Characters are designed with the goal of highlighting something about the protagonist.
Fun fact, the term "foil character" comes from a jeweler trick where metal foil is situated behind gemstones to make them look brighter in contrast.
Although Foil Characters are not always the villain, they can be. This is seen in villains who share the hero’s motivations but not their morals, doing reprehensible things which the hero would argue, "the ends didn’t justify the means." In other cases the anti-hero fills the Foil Character role, so readers can observe a spectrum of good and bad.
Foil Characters can (and should) exist in every type of story, not just those with an easily definable caste. Sometimes Foil Characters can be hard to spot until their duality to the main character hits its peak, deeper into a story—or perhaps, they’re only identifiable in hindsight.
An example of a far more complicated rendition of a Foil Character would be the younger sibling of a main character that’s suffered great trauma (alternatively, any character filling the role of "the innocent" contrasting "the tainted"). Although they may not counter the protagonist in an outward way (through dialogue or actions), their presence in the story serves as a stand-in: an image of the main character "before," contrasting against their lifestate "after." Without enduring said hardships, who would the main character have been? In this, the Foil Character shows how they changed.
Foil characters can be anyone, so long as they are written in a way to reflect the main character’s traits: the antagonist, anti-hero, friend, family, partner, pet.
A classic example of a Foil Character is the sidekick, Dr. Watson, to detective Sherlock Holmes, in Sir Arthur Conan Doyle’s works. Watson, who is practical and compassionate, contrasts Holme’s detached brilliance, often butting heads, but coexisting to bring out the best in one another. This dynamic has persisted across the Mystery genre in innumerable iterations, such as the also famous, Mulder and Scully, from The X Files tv show.
A more modern example of a Foil Character is Draco Malfoy, from the Harry Potter book series. Draco parallels the main character, Harry, as a child raised on the opposing side of the conflict tearing their Wizarding World apart. By the end of the series, another notable Foil Character to Harry is revealed in Neville Longbottom. Born under the same prophecy and suffering of similar circumstances in orphanhood, Neville serves as a "what if," had Harry never been thrust into the spotlight as the Chosen One: still brave and incorruptible, even without the extra help or societal expectations.
To keep this thought-train for complex and intentional character writing going, you should check out $ How to Write a Dynamic Villain That’s Not a Boring Cliché$ . As much as any protagonist can benefit from a few Foil Characters, every hero needs a good villain!