Inside the challenges of bringing the unbelievable story to PBS’ Masterpiece.

[Editor’s Note: The following article contains spoilers for Parts 1 and 2 of “Mrs. Wilson.”]

“Mrs. Wilson” star and executive producer Ruth Wilson was a teenager when she first discovered that her grandfather was a secret bigamist. That’s when her grandmother Alison Wilson released the first part of her memoirs in which she details how, after her husband Alec died, a woman showed up on her doorstep and claimed she was his real wife, Gladys. The subsequent search for the truth and the shocking secrets uncovered all became fodder for the Masterpiece suspense series “Mrs. Wilson.”

“I was around 18 when I read her first section of the memoir, and that was about Alec and finding out about the first wife,” Ruth Wilson said in an interview with IndieWire. “We didn’t, as a family, ever know about it, there were no photos of him, there was nothing, my dad never spoke of him. There were these secrets in the family that were always just present, but were never expressed or talked about. My granny didn’t encourage conversation about it, and even once we had the memoir, none of us felt we could really ask her any questions about it.”

However, Alec Wilson’s two families began to have conversations around 2007, constructing what memories they could about his life during his frequent absences. In order to juggle both families, he told elaborate lies about traveling abroad and continuing his work with MI6, tales that would eventually find their way into his stirring spy novels. The story of the two Mrs. Wilsons and the imaginative Alec began to take on a life of its own, and eventually, the family decided to share the bizarre tale with the world.

“There was a big discussion about whether we bring our family’s story into the public,” said Ruth Wilson. “I’ve always been quite a private person, but the story is extraordinary, and every time I told it, I never got bored of telling it. Everyone I told was always amazed, and had either their own similar story, or would just be intrigued with the characters involved. So to me, it doesn’t feel that personal after a while, that it’s just a brilliant story to tell.”

BBC/©WP Films Ltd.

Once BBC and Masterpiece were on board, screenwriter Anna Symon came on to try to make sense of the story, which she thought would work well to mirror the fact-finding mission the Wilson family had been through. Ruth Wilson would play Alison, who would become a “detective going to pick up clues to try and find out who it was she was married to.” As for who would play the notorious Alec, Iain Glen (“Game of Thrones,” “Downton Abbey”) learned that “Ruth particularly, was desperate for me to do it,” and the casting proceeded from there.

Symon was faced with the same challenge as Alec Wilson’s families had in trying to construct a picture of who he was based mostly on Alison’s memoir and their own memories. “The start of my research was going to meet Gordon and Nigel, that’s Ruth’s dad and uncle, who are key characters in the show. Pretty much everyone who knew Alec just said how much they loved him and respected him and adored him. So I really felt like I had to respect that in the script,” said Symon.

“I did a massive chart of all the different families, when he had a child. And then the family members were very helpful,” she added. “One of them would say, ‘I found out Dad wasn’t at my birthday party when I was eight in 1950-whatever.’ And then the other family would be like, ‘Well, I got married in …’ So you’re thinking he’s criss-crossing the country. It’s extraordinary.”

Glen also turned to Alec Wilson’s spy novels for insight. “I read a couple of those, and specifically his most famous creation, which was the Wallace Mysteries. The central character in that was almost a glorified version of himself,” he said. “I could see that certain exploits that he mentions in his novels were similar to things that we know he did in his life — [they] were similar to lies that he made up. I just think the whole thing got really twisted in his head and what may have started as professional deceit turned into personal deceit, turned into, ‘I don’t know which bits are deceit anymore.’”

BBC/©WP Films Ltd.

Over the course of the first two parts of “Mrs. Wilson,” Alison uncovers several more shocking secrets. Alec lied about owning an ancestral home (which was actually a converted military hospital), about various covert missions, and most shockingly, about having a third wife, Dorothy, who was never mentioned in Alison’s memoir. In real life, Dorothy’s grown son Michael Shannon asked researcher Tim Crook to look into his father’s death, whom he thought had died on a mission in 1941. They uncovered the truth about Dorothy being Alec’s third wife, which led to connecting with the other two families.

“The first wife, Gladys, the events of their meeting and the funeral, that’s all from the memoir,” said Symon. “And then I read the memoir very closely, and there’s a line in it where Alison says something like, ‘I found a stash of letters and I discovered the huge infidelity — the truth of his infidelities.’ And I kind of extrapolated those letters out into thinking that she may have found out.”

Symon dramatized this revelation in the series by having one of Alec’s colleagues (Anupam Kher) mistake Alison for this third wife at the funeral. This leads her to seeking Dorothy (Keeley Hawes) out, and at that point it’s revealed that she had decided to protect her son Michael by telling him his father had died in the war. “I’ve created a myth, but I’ve stuck to the emotional truth of it,” said Symon.

Although making “Mrs. Wilson” created this fantastical, mythic picture of Ruth Wilson’s grandfather, the project also helped her feel closer to her grandmother, who died in 2005.

“Every Sunday we had lunch with her, and she’d pick me up from school, and those things, but I didn’t really know her very well,” she said. “She was very reserved, and to read this memoir, I realized she was so full of emotion. She wrote poetry. She was a woman bursting with a need to be loved and to love in the purest form, and with the most amount of intimacy. I think for her, she sort of believed in sacrificial love of some form. ’I give everything to this person.’ And so Alec’s betrayal was even greater for that, I think.”

BBC/©WP Films Ltd

When it came time to tackling the role, the actress had an even more visceral feeling of connection with her grandmother.

“During the show, I had this incredible energy running through my veins, as I played her in the ‘60s, that era when the carpet’s being pulled from under her feet all the time,” she said. “It was pretty uncomfortable to play, and I felt deeply self-conscious. But it added something; I think it was partly her flowing through me.”

Although that experience may sound unbelievable, Ruth Wilson acknowledges just how bizarre every part of the story and telling it has been — especially when she had to portray Alison giving birth to her second son Nigel.

“Giving birth to my dad was weird. Definitely a moment when I was like, ‘Oh my God, that was just a bit strange.’”

”Mrs. Wilson” concludes on Sunday, April 7 at 9 p.m. ET on PBS.

Sign Up: Stay on top of the latest breaking film and TV news! Sign up for our Email Newsletters here.