A character foil is a character who acts as a contrast by highlighting one of another character’s qualities.
In a story, a foil is a character who contrasts with one more character —commonly the hero of the story. This is to highlight specific qualities of the former character. In some cases, a subplot can be used as a foil to the main plot. A foil usually either differs dramatically or is extremely similar but with a key difference setting them apart.