The third season of Hulu’s dystopian drama “The Handmaid’s Tale,” as showrunner Bruce Miller puts it, saw an “opportunity to do something rebellious drop in [June’s] lap.” The titular handmaid (played by Elisabeth Moss) learned about an underground network that could smuggle people out of the oppressive regime of Gilead and decided she had to be a part of plans to cause that regime to crumble from the inside.

“For June it was a combination of imagination — what could she have done? — and then execution. So much of the season was about her learning to be a rebel — what it meant on the ground, moment by moment and how you do those things and who you have to compromise with,” Miller tells Variety‘s TV Take podcast. “Becoming a rebel, and how do you actually rebel, was interesting to me because I have no idea.”

Thinking about the Rebel Alliance in “Star Wars” and “what do they do day-to-day?” gave Miller some inspiration, as, all season long, his team of writers and producers were “trying to do is fill up her toolbox, so in the last few episodes you start to see her use those tools.”

Some of these tools were what June had learned about the inner workings of Gilead, starting with the way they can smuggle people out using the Marthas and some sympathetic people in higher power, as well as the level to which some people within the new regime would simply turn a blind eye to disturbing imagery. The latter point became clear to June, Miller notes, after she killed High Commander Winslow (Chris Meloni): Not only was it extremely easy to get someone in to remove the body, but when she walked down the hallway in Jezebel’s after, she passed a guard who didn’t bat an eye at her own disheveled and bloody appearance. But some of the most important tools in June’s arsenal have become what she has learned about herself — not only in the “spring to action” way she physically defended herself against Winslow, but also her careful calculation of stepping back and allowing Eleanor (Julie Dretzin) to die, as well.

Out of all of the experiences June had in the third season, Miller says the hardest one to crack as a writer was, “How do you keep your sanity while you’re learning to do something where you’re putting yourself — your life — at risk? And not only that, it’s not like teaching yourself to rock climb without a rope and you’re putting yourself at risk and that’s it, here she is constantly putting other people’s lives at risk throughout the season, and they get killed.

“How does June harden herself against that kind of pain so she can go forward? You have to be able to endure that kind of hit or you can’t be victorious in some sort of battle where you’re actually playing for keeps. But, she’s not the kind of person who can absorb that hit without feeling something.”

Although earlier in the season June certainly tried to push the emotions aside and just steel herself, that proved to not be true to who she was. It took her relationship with Ofmatthew (Ashleigh LaThrop), Miller says, to “realize instead of pushing these enemies away, she has to fight for everybody.” Ofmatthew died after June confessed to Aunt Lydia (Ann Dowd) that Ofmatthew didn’t want her baby. The other handmaids shunned her, and she ended up attacking Janine (Madeline Brewer), which caused the guards to shoot her. Ofmatthew was kept on life support until her baby could be safely delivered, and then she ultimately expired.

Now June has “the knowledge that all deaths are not equal,” Miller says. There was acknowledgement on June’s part that Eleanor, who has bipolar disorder, has had it “very difficult” within Gilead, where she can’t get the medication she needs. But if Eleanor were to leave, “she doesn’t want to have this place on her conscience,” he continues. While in some ways, June’s choice could be seen as an act of mercy, it also certainly benefitted her in the moment — as Eleanor had been speaking about saving the children in ways that could tip off June’s plan to get them out of the oppressive regime. As Miller puts it, “What she’s learning along the way is [to] let people make their own choices about those big things and she can be as careful or underhanded or practical as you want her to be.”

At the end of the penultimate episode of the season, entitled “Sacrifice,” Eleanor’s husband Commander Lawrence (Bradley Whitford) was grieving but still in a sharp enough state of mind to seem to puzzle over June’s role in his wife’s death.

“He has a great understanding of human nature but not such great intuition of human nature, so in some ways he’s looking at her and trying to puzzle out, ‘Could she be this? Could she be that?'” Miller says. Lawrence’s suspicions abut June will “come to bear” in the season finale, which becomes about, “Who does she think she is?”

But, he admits that since they have so much story to get through in that one episode, the larger and longer-lasting effects from what Lawrence learns about June is a story he will hopefully get to tell “moving forward” in the fourth season.

Miller says he didn’t go into the third season finale knowing for sure that there would be a fourth season, although he trusts that he, his studio MGM and his network Hulu are on the same page about telling the story until it can reach its satisfying end. When he broke the story for the third season finale episode, therefore, he was more focused on making sure the end came with a feeling of June getting an opportunity.

“She’s gotten opportunities before in the season, but she’s finally able to bring all of those skills she’s learned to bear, and we get to see if it’s enough — or not,” he says. “Right now she’s kind of on both a noble and revengeful path. She wants to do something that’s good, but she always wants to basically make all of these mothers hurt the way she hurts.”

The second season ended with an episode following June as she attempted to get out of Gilead, only for her to decide at the last minute to hand her baby over to Emily (Alexis Bledel) and instead stay behind for her elder daughter. And as Miller previews, the third season may end in a similar vein. “You don’t necessarily have to get all of the kids out to make that happen,” he says of hurting the other mothers in Gilead. “You just have to get them away from their parents.”

Miller has yet to start truly planning the story for the fourth season, although he notes that when deciding about what characters to learn more, he says he “100% follow[s] my own curiosity. I just try to think of, ‘What are the stories that I’m interested in seeing?'” Of course, though, he always has to keep front and center in his mind that the show is told from June’s point of view, and she’s narrating it, so the events have to be ones that she would have eventually heard about, if not seen with her own eyes.

The third season finale of “The Handmaid’s Tale” streams Aug. 14 on Hulu.