Spoilers follow: Do not read on unless you’ve seen “The 100” Season 3, Episode 7, titled “Thirteen.”

Nothing gold can stay in the world of “The 100,” and the show never hesitates to remind us of the dangers of post-apocalyptic Earth by killing characters with gleeful abandon. This week’s casualty was Grounder Commander Lexa (Alycia Debnam-Carey), who inadvertently ended up dead at the hands of her second-in-command Titus (Neil Sandilands), after he attempted to kill her lover, Clarke (Eliza Taylor).

The hour also revealed that the Artificial Intelligence program known as ALIE was not only responsible for the nuclear apocalypse that destroyed the world and necessitated the Ark’s sojourn in space, but that the second iteration of the program formed the foundation of the Grounders’ religion, with ALIE creator Becca (Erica Cerra) becoming the first Commander to the nuclear survivors left on Earth. The AI has subsequently been passed down from Commander to Commander through an implant, collecting their consciousness as a form of reincarnation.

Below, “The 100” showrunner Jason Rothenberg explains the decision to kill Lexa, the origins of the AI storyline, and how Lexa’s death will affect the politics between the Grounders and Sky People.

Was Lexa’s death necessitated by Alycia’s schedule on “Fear the Walking Dead” (on which she’s a series regular), or would you have gone this route with the character even if she didn’t have another show to get back to?

That’s a good question, and it’s very hard to separate the two because I knew before we cracked the story that that was going to be an issue, and I knew how many episodes I had her for and I knew that she had to stop working by a certain time, and then after that it would be like, we’d pray that her schedule would line up and perhaps we could get her back for a spot here or there for a day. So that was definitely in my thinking when we broke that story.

What happened at the same time was… it was the very beginning of the season — I don’t even think the writers had started yet – the day that I came up with the idea that the second AI was inside Lexa, (“Thirteen” writer) Javier Grillo-Marxuach, who’s my co-EP this season, was coming to meet with me, and I had a couple other writers in to meet with him to see if everybody got along, and I was literally complaining about how I had these two great stories: I had this Grounder political conflict caused by what Pike (Michael Beach) was doing in Arkadia and the conflict between the 13 clans, and I had this AI story, but there was no unification moment – there was no grand unifying theory of the season.

We’d talked about reincarnation as the way that the Grounder leaders had been selected in Season 2, and I didn’t want to dispense with that as an idea; I didn’t want to say it was nonsense, which Clarke was obviously clearly thinking that it was, but I also didn’t want to say that it was actual spiritual mystical reincarnation. So then I struck upon the notion of a technological reincarnation, and everything fell into place there. And obviously, if you’re going to tell that story, to be reincarnated you kind of have to pass away first. So it all came together in my thinking, and it’s tragic on some level because nobody loves Lexa more than I do, and Alycia has been a joy to work with and loves the character, and she and Clarke have such great chemistry. I would’ve made her a series regular in a second if I could, but that couldn’t happen.

The plot obviously moves very quickly in “The 100,” which is part of what I appreciate about it, but it did feel like we didn’t get much time to explore Clarke and Lexa’s relationship in depth before it was shattered. What would you say to fans who are frustrated that we only got a hint of it? Is there a chance we might see Lexa again in some form?

Without being too spoilery, the flame that came out of Lexa collects the spirits of the Commanders … if that’s true, then I do believe that people could anticipate perhaps seeing her again in that way, somehow. But the truth is that Clarke is now going to be in mourning over the loss of this woman who meant so much to her, and that’s going to really hang over the rest of the season. She’s grieving in a big way, and part of her story going forward is going to be – and this has kind of been her story from the beginning — “how do I go forward as a leader in the face of tragedy?” She had to do the same thing after Finn (Thomas McDonell) died, she had to do the same thing after Wells’ (Eli Goree) death in Season 1.

This is a world where people die; it’s a tragic, difficult world and Clarke has had to compartmentalize emotionally the way that we all do in life – we can’t let tragedies destroy us because we still have to go on. So that’s Clarke’s journey going forward now – how can she do what’s right by Lexa’s memory? So we’ll see that, for sure … I think it’s probably the most developed we’ve ever had any relationship. The Finn relationship didn’t really have a lot of development either — not that that’s a good thing or a bad thing, but this is not a soap opera, so it’s really not about their relationship, it’s about how they as leaders have a role to play in the bigger tapestry that is the story we’re telling, and the fact that they are in love with each other is a part of it, but it’s not everything. I think it complicates things now going forward emotionally for Clarke in a really significant way.

The weaving of the AI and the Grounder mythology seems so organic that I’m surprised it wasn’t a long-term plan; how often do you leave room for those moments of luck to strike versus having the big thematic tentpoles laid out in advance?

Some of it is we sit and we think of what the bigger story that we’re telling is, series-wise, and then you get to the end of a season and you’ve painted yourself in certain corners and certainly as a finale begins, they’re in such a screwed position that how do you get them out of it? This was something that, to be honest, was kind of just a magical moment and all the ingredients were there, they just hadn’t coalesced yet. I’d be lying if I said I knew in Season 1 that there was an AI inside the Commander that we were gonna meet in Season 2, but little things, when these creative epiphanies happen… Nobody’s really pointed this out yet that I’ve seen — maybe because they haven’t been made privy to the fact that Lexa has an AI augmenting her consciousness — the jewel that she wears between her eyes is a gear; it’s a technological symbol. It was just one of those weird things, just like we’re now telling a big story that involves the infinity sign; the infinity sign is the corporate logo of Becca’s company that created ALIE and created the second AI, and our logo for the show has the two zeroes in “The 100” colliding together and forming an infinity sign, and post-deciding that was going to be the symbol, [we realized] that it was baked in the cake to begin with in a cool way.

The City of Light was such a bizarre concept in the first few episodes of the season that I couldn’t engage with it, but getting a little more backstory on ALIE and what we’ve been seeing in recent episodes has helped pique my interest. When can we expect answers about what exactly the City of Light is and how it works?

Obviously it didn’t play in this episode very much, but it will definitely be a thing that hums along until it becomes a bigger and bigger issue for the show. It’s interesting that you had that reaction; my feeling was, going into this season, that it’s such a different kind of story for us that I wanted it to be something that did percolate as a B-story for a little while until it exploded into the bigger narrative that we’re telling and then became a much more important story as the back half of the season unfolds. I’ve been satisfied with the reaction that people are now interested and fascinated by [it] — some of it has to do with Raven (Lindsey Morgan) becoming a part of that storyline. I think the moment that Jaha (Isiah Washington) forgot that he had a son was the beginning of the “holy s—t, what is this thing that they’re all willingly doing? What are the ramifications of it and how much control will ALIE get over our minds and what does it mean to give up control to something like that?” That’s all story that we will tell going forward.

The theme of the season is “what does it mean to be human?” and this is something that, in this episode, we really explore with Becca and the Commander up on the ship in the flashback, where she says “ALIE 1 didn’t know what it meant to be human, but ALIE 2 will, because she’s going to join with us,” and so that’s what the upgrade is. The upgrade is that the second AI is augmented by a human being, by humanity, and the first one was not. Lexa’s not an AI, Lexa is a woman who happens to have an augmented consciousness in the form of this AI.

I liked the structural choices you made in this episode, with the focus wholly on Polis and the flashbacks without visiting Arkadia – will next week’s episode take the opposite approach, and focus wholly on Arkadia and not the Grounders, or will we get a more traditional format?

Without giving too much away about the episode, we will definitely tell a big Arkadia story in the next episode. We will begin to see the ramifications of the fact that Pike has a rebellion on his hands, that he now knows about because of what Octavia (Marie Avgeropoulos) did to warn the village, which led to the death of people on their side of things. Bellamy (Bob Morley) is going to face harder and harder choices with regard to who to support.

As far as Lexa was concerned, Pike really seemed to be the main bone of contention, since Abby (Paige Turco) and Kane (Henry Ian Cusick) were open to peace – how much of a focal point will Pike’s leadership be in the next run of episodes?

It’s interesting, because now that Lexa is gone, politics have to step aside for a moment. In Polis now we’ll see the conclave and the selection of a new Commander and how that will play out, but they don’t know that that’s happened in Arkadia, so in Arkadia, we will see the paranoia that now begins to take hold — who’s part of this rebellion and neighbor spying on neighbor. It’s a little bit of an internal focus in both camps, Polis and Arkadia, for a couple episodes, before things reconnect.

What can you preview about the new Commander and how open-minded they’re likely to be following Lexa’s death?

The conclave is about to begin and we will see that unfold coming up. Obviously Aden (Cory Gruter-Andrew) — who is the one Nightblood that we have met — seems to be on the side of Skaikru. I think it was in episode 4 before Lexa went to fight Roan (Zach McGowan), we introduced this kid Aden, and he said “if I should become Commander then I will honor the 13th clan.” Whether he wins or not is something that people will have to tune in to see.

Will we explore more of the Grounder clans in the rest of the season, since we’ve mostly been focused on Trikru and Ice Nation so far?

We will; we’ll definitely begin to understand more and more of what the power dynamics are within Polis. There are new worlds [we’ve] yet to explore this season; new characters that we will meet that are not part of Polis or Arkadia, but I don’t want to tease too much about it other than to say the world of “The 100,” what I love so much about it is, we’re constantly expanding and constantly revealing new places and new people and new clans and new things about this post-apocalyptic Earth.

“The 100” airs Thursdays at 9 p.m. on The CW.

Were you sad to see Lexa die? Did the AI twist surprise you? Share your reactions and predictions below.