"I just think they wanted to do something new and exciting and fresh for the parents," Williams said on Monday on The Late Late Show about why Osbourne was a character in the play.
"I realized that everyone at school kind of thought that this character was really strange, but all of the parents loved it they were like, 'Sharon Osbourne in a nativity play. This is perfect.' So I was really hamming it up," she continued.
Williams said that she wore black boots and red hairspray to impersonate Osbourne and that acting in plays helped her realize she enjoyed performing.
"It brought people so much joy and I think then I knew I just want to entertain people," the 23-year-old said.
Williams will next be seen in X-Men film The New Mutants, which hits theaters on Friday. The film follows a group of teenagers with mutant powers who are being held in a secret facility against their will.
"What I really loved about it, honestly, was just that these are teenagers and although we think of them as superheroes, they really are just trying to figure out themselves and trying to figure out how to exist within the world," she said.