The Red Daughter's origin story was tackled on Supergirl Season 4 Episode 16.
The episode rolled back three years back to 2015 when Lex was on trial. James and Lena both testified just before Lex poisoned everyone in the courtroom and was whisked away.
As he was taken to his cell, he met Eve Teschmacher, a Lex Luthor superfan eager to work with him as she believed he the last hope at protecting the Earth from aliens.
Lex asked Eve to get a job at CatCo where she could remain close to James, Supergirl and Lena.
About two-and-a-half years ago, the Red Daughter walked into a military base in Kaznia dazed and confused. At first, the government wanted to weaponize her, but when her powers became uncontrollable, they called in Lex Luthor for help.
He bribed the warden into letting him get out of prison for the weekend so he could "take care of business."
What a huge mistake on the warden's part.
All the Red Daughter knew was the word 'Alex' referring to Kara's sister yet Lex took advantage by telling her he was 'Alex.'
This began a mentorship as he taught her English and prepped her to one day face her "sister" Supergirl by making the Red Daughter view the American's as enemies.
The Red Daughter quickly caught on and began questioning Lex's motives. She accused him of using her to get back at his sister, Lena, which didn't sit well with Lex.
Lex needed to keep the Red Daughter in his corner so he tried to attack the only thing she loved, Mikhail, a little boy she saved in the village of Kaznia.
Otis saved the kid, thankfully, but the Red Daughter is furious with the despicable Americans.
Still, Lex and the Red Daughter's relationship was already strained, that is until she fell ill and he did everything in his power to save her including giving himself cancer so he could get the Harun-El from Lena.
After Lex takes the same cure as James Olsen, he gives the Red Daughter a blood transfusion.
She's grateful that he saved her life and vows to repay the favor by waging war against Supergirl.
We also find out that Lex is responsible for Ben Lockwood's rise to fame as he needed someone charismatic and unafraid who would promote his anti-alien message to the world.