During the many iterations of the Marvel Cinematic Universe since 2008, rarely has a project been as personal as “Ms. Marvel,” the six-episode series that aired its season (perhaps series) finale on Wednesday. The series serves as the origin story for its eponymous superhero, a teenage girl named Kamala Khan (Iman Vellani), whose powers are unlocked after she places an ancient family bracelet on her wrist. Over the course of the series, Kamala learns that the origins of her powers link her to the Stowaways, a group of supernatural beings – including her great-grandmother – who are trapped on Earth from an alternate dimension and are desperate to use Kamala’s bracelet to to return home. But the show spends much more time exploring Kamala’s heritage as a first-generation Pakistani-American Muslim living in Jersey City who worships the superhero Captain Marvel, aka Carol Danvers (Brie Larson). Kamala fights and then bonds with her traditional mother, Muneeba (Zenobia Shroff). She attends the lavish wedding of her brother, Aamir (Saagar Shaikh). and eventually flies to Pakistan to learn more about the bracelet from her grandmother, Sana (Samina Ahmad). In the fifth episode of the series, Kamala is even transported back in time to the violent and traumatic partition of India in the late 1940s, when millions of Muslims were forced to settle in the newly created country of Pakistan. For the show’s creator and head writer, Bisha K. Ali, it was all an opportunity for her to shine a bright, Marvel-sized light on a life experience that had virtually never received the big-budget, blockbuster treatment in America. Ali spoke to me Variety about how personally important so many of the show’s creative choices were to her and the other writers, what she regrets about never making it onto the show, and what Marvel Studios head Kevin Feige’s reaction was to her wanting to portray the true story segmentation event in a superhero television series. Yes, Ali also talks about the delightful revelation that Kamala’s powers come from a mutation of her DNA — 1990s “X-Men” themed music! — and Carol Danvers’ surprise post-credits appearance teasing Kamala’s role in Marvel Studios’ 2023 feature film, “The Marvels.” I’m one of the many who squealed with joy at the first mention of mutants in the MCU. What can you tell me about how it came about? Next to absolutely nothing. One of the puzzles we had from the beginning was that we know that her powers are inherited in the TV show, and the thing about inheritance is that it leaves you with this nagging question of “Well, if they’re inherited, everyone in this lineage should they have them.” And that’s been something that we’ve been playing with in ways of reaching out. And then came the solution! I don’t know how it fits into the larger MCU. I honestly can’t answer that. Not because I’m lying. Because I do not know. Kevin does what Kevin wants — who knows? The man is full of mysteries. It was just this perfect piece. But the fact that we got to introduce this part of the MCU to our show, my nerd couldn’t be more excited. You said the solution “arrived” — it was that one of the Marvel executives came into your writers’ room when you were talking about this problem and said, “You I knowyou could say only mutants”? Not exactly like that. Keep in mind that we had written full drafts before any of us had heard the word COVID before. In this process, you go back and forth with Kevin, you go back and forth with the rest of the team. There are weekly check-ins as we build what our show is anyway. And then the timing runs out and then you get a message that says, “Hey, let’s do this.” And here we are. Also, there’s the post-credits scene where Kamala kind of turns into Carol Danvers… Kamala doesn’t turn into Carol. Oh, I mean Kamala switches places with Carol — is that more accurate? Right. It’s an important distinction, precisely because in comics, that’s something that [Kamala] she does — she can change her appearance and looks like Carol Danvers in issue 1 of the comic. It doesn’t turn into Carol [on the show]. This is Carol Danvers standing in Kamala’s bedroom. Was there any discussion about bringing Carol earlier? Kamala hasn’t met her idol yet! Certainly at the very, very, very beginning, way back when, that was part of the conversation. The more I dug deeper into what I wanted to say with the show and what I wanted it to get across, it really had to be about her and her community and her family and her friends. So Carol met up with her after this trip she had spent on the season. She is Kamala herself. He looks in the mirror at the end — he doesn’t see a copy of Captain Marvel the way he does in episode 1. He sees Kamala wearing a costume her mother made for her, with the masks Bruno made for her, with the sheet from Red Dagger — then, moments later, named after her father. This moment is for her to become herself. So I think he would have taken it off in a different direction if he had met [Carol] sooner than he meets her, who is in the movie coming out next year. She will still be so excited and so happy for them to meet, when they finally do. But in this journey, in this character arc, it felt very important, actually, that they didn’t meet. The smugglers, led by Najma (Nimra Bucha), are referred to as djinn — a real part of Muslim and South Asian cultural history — in the show. How did you and the writers decide to integrate that into the Marvel Cinematic Universe and Kamala’s personal story? It is worth saying that it is not jeans. In episode 4, they openly say that they are not jeans. I can’t speak for the whole Muslim world, but certainly from my background growing up, when something weird happened, it was always like, “Oh, is that a jinn?” If someone is behaving strangely, it was somehow the work of the genie. Certainly in Pakistan, so we would talk about something that is supernatural, beyond our explanation. It’s been that way for generations. The other part is also in Episode 3, when Najma tells her that people call us jinn — it’s the worst thing possible [Kamala] could. It is, emotionally, a nightmare. That’s what leads her to say, “Well, I can’t be a superhero.” Because there is nothing worse that he could imagine it to be, because of the negative connotation we have with jeans culturally. So that’s what we’re really after. In episode 4, we learn that the Clandestines are trying to return to the Noor dimension using Kamala’s bracelet, but doing so would cause that dimension to overtake our own. This implied that we would see this fight happen in the final climax of the series, but it ends up being a showdown between Kamala and Najma that is resolved by the end of episode 5. Was there any version of the series where this was the grand finale? No. I’d say there’s a lot missing. There are, for example, essays we’ve written about the Clandestines, the Noor Dimension, the Red Daggers, and how it all ties into everything else. There are huge groups of character arcs that for us to be able to do in the time we had, with the situation that changed [due to] COVID — I think we’re missing a lot of some of the parallels between the two different kinds of families. I think we’ve lost a lot of character development for the Clandestines. I wish I could show you more of what we had. So this emotional climax was about two women, a different mother and for Kamala who represented her kind of family. And these two things completely conflict with each other. That moment was about Kamala getting into her fighting style, which is always defensive. He always talks to people first. Her goal is always “Hey, how are you? Can we solve this without anyone getting hurt?” You see it again in the finale. So it was always built so that this event where the universe joins another universe, that wouldn’t happen. Also, we’re a six-hour TV show. We will never be able to have one universe completely subjugated by another. But the main function of this for me, emotionally for Kamala’s character, was to figure out how she’s going to deal with these difficult situations when things get spicy when she gets home. The Department of Damage Control is also something of an overtly competitive force on the show as Agent Deever (Alysia Reiner) hunts down Kamala and Kamran (Rish Shah) in Jersey City. In previous iterations of the MCU, Damage Control was perhaps more neutral. Everyone’s Damage Control was really, I mean, I don’t know if I could put the analogy in a clearer light in terms of over-policing, profiling and tracking Muslims. I think the thing we need to know is that Agent Deever goes rogue. So there’s a little bit of flexibility there, because I didn’t want to say that all the damage control is overkill. And that’s how we want to keep it within MCU land and not use an actual state service in any way. But this is our way of telling that part of the story that is intrinsic to Kamala and who she is and the community she is in. This is probably a question you can’t answer, but I’ll ask it anyway: I wondered if Agent Deever and Agent Cleary (Arian Moayed) were meant to foreshadow the events of the upcoming Marvel Studios series…