This piece contains major, like, the most major spoilers for Detective Pikachu.
All detective stories tend to end on a twist -- It was the butler all along! The secretary committed the murder! -- but you will not see the ending of Detective Pikachu coming. Director Rob Letterman planned it that way: "There's a lot of little misdirects," he explained to Thrillist. "It's all just, 'Look over here, look over here, don't pay attention.' But the twist of the movie is not really a detective plot twist reveal at the end, it's an emotional twist reveal. It has nothing to do with the villains, really; it's the father and son story."
The movie, which is modeled in the same vein as classic noir and neo-noir detective stories like The Maltese Falcon and Blade Runner, does have one classic bait-and-switch that fans of Pokémon might expect. For most of the movie, our heroes think the power-hungry business executive Roger Clifford (Chris Geere), and son of Ryme City founder Howard Clifford (Bill Nighy), is the real villain, but, in one climactic scene, he's revealed to be Howard's Ditto, while the real Roger was tied up in a closet in his dad's office. When he takes off his dark aviator sunglasses, "Roger" exposes his beady black Ditto eyes, which look absolutely terrifying gazing out of a real human face. It's the best kind of Cronenbergian body-horror that catches you just slightly off guard, but Detective Pikachu has yet another twist coming.
At the end of the movie, after our heroes have defeated both mind-controlled genetically engineered Mewtwo and the real villain -- the elderly Howard whose evil plan was to use Mewtwo to merge humans and Pokémon together -- there's one last surprise waiting for the audience. The freed Mewtwo, whose psionic abilities, along with a special mind-altering purple gas nicknamed "R" by black market peddlers, were being used to facilitate Clifford's soul-melding plan, saves one last person: the one Tim Goodman (Justice Smith) has been searching for this whole time. The amnesiac Detective Pikachu, a little mouse-like creature in a deerstalker hat whose gruff voice only Tim can understand, is revealed to actually be a combination of Tim's missing father Harry, one of Ryme City's detectives, and his Pokémon partner, who, after all is said and done, is nothing more than a regular friendly little Pikachu.
But how did Harry get into his Pikachu in the first place? Well: Harry had been investigating the underbelly of Clifford's business. He had discovered a remote facility where Pokémon were being genetically tested on and, more importantly, Mewtwo was being kept in an isolation tank so its power juice could be extracted to make the R compound. Harry and his Pikachu infiltrated the top-security base to free Mewtwo -- which they succeeded at -- but triggered the alarm system. The freed Mewtwo, realizing that these were the good guys, intervened in their escape by hiding Harry inside his furry companion with the same powers Howard wanted to exploit to evil ends, saving his life from Clifford Enterprise goons. Undoing this brought back Harry's corporeal body, coffee addiction and all, and Pikachu's memories it could no longer vocalize beyond adorably inscrutable "pika pikas."
"The ending, it's funny. That was the whole design of the story for me, personally, all along," Letterman said. "The whole father and son story, every scene, it's all driving towards that. That relationship I take personally, because I'm a father, I have a son. For a movie like this, you want to be able to strip away the Pokémon and have a human story stand on its own, and that was really it. That's what kept me going for the last two years. My original pitch literally was 'the father he's looking for is with him the whole time.'"