Mirrors in fiction are characters who reflect the main character and reveal insights into the main characters behaviors, thoughts, and motivations. A mirror allows the main character to check the state of their own being or learn lessons from their mistakes.
Secondary characters often act as mirrors for main characters, however, that should not be their only purpose in a story.
Character traits in a secondary character that will be used for a mirroring effect need to be used realistically. This means that these traits need to come from somewhere and not exist in a vacuum.
Develop an element of his or her backstory that explains the trait, such as relentless pursuit of monetary success being related to a parent who could never consistently provide for that character as a child. The main character can see the actions the secondary character takes to reach his or her goal and use that as a barometer for how much she is letting her drive for financial success compromise her moral standing.
This level of similarity is recognized by the main character and causes dislike or disgust (or with an opposing trait, longing and need for a similar situation like a happy and respectful relationship). The main character thinks he or she knows the secondary character and can predict or expect a certain action or reaction, but often fails to fully see the same in his or her self, which leads to making mistakes. The reader sees the bigger picture and similarities more fully when this is done well.
Having said that, if the secondary character only exists as a mirror, that character will feel flat and less relatable. If their actions or emotional responses are too easy to predict the reader will be bored and likely not find that secondary character believable, which then lessens the mirroring effect. Emotions and drives are complex, and that needs to be true for secondary characters as well as main characters.
Well developed secondary characters are not always predictable, but when they do act as complex mirrors they provide opportunities for the main character to make mistakes and learn from them in a more believable way.