Liz Sandoz's appearance on The Bachelor caused quite a splash, and now host Chris Harrison is revealing why producers put her on the show to begin with and kept it a secret from Nick Viall.

Sandoz and Viall had a one-night stand at her best friend Jade Roper's January 2016 wedding to Tanner Tolbert. Sandoz revealed to The Bachelor cameras Viall asked for her phone number after having sex that night but she declined, thinking he was just being polite.

About nine months later, 29-year-old Sandoz shocked Viall by choosing to compete on Season 21 of The Bachelor without ever trying to contact him first. Viall therefore questioned whether the doula from Las Vegas wanted to date him for the right reasons.

"We figured Nick could always let her go if he was not into it," Harrison told Yahoo! TV.

"That is just our kind of story, our kind of twist, a total lay-up. [Liz] convinced us that there's a history there that she's not ready to give up on yet. She is a very sweet girl and pretty. We confirmed that this had happened, and we did not tell Nick about it."

So why didn't producers warn Viall prior to the start of filming The Bachelor that a woman from his past would be showing up?

"We wanted that to be a surprise to him on Night 1," Harrison admitted. "If we told him and prepared him that someone he knew was applying and picked, he would put his guard up. Not telling him made him deal with a real-life moment and see what happens when they meet again."

Harrison acknowledged that Sandoz "kept the secret for awhile" during the season, as did Viall.

"But obviously in The Bachelor house, secrets do not stay hidden," Harrison revealed. "So eventually it's going to come out that she already knew him."

Sandoz told the cameras she had chemistry with Viall at Roper's wedding and therefore wanted to get to know him better. She worried, however, about making a move too late.

"She applied after finding out Nick was going to be the Bachelor. She told us the story about how they hooked up at this wedding and they hit it off. She thinks they have unfinished business and wants to see where it could go," Harrison noted.

The Bachelor premiered January 2 on ABC and will continue to air on Monday nights.