On paper, the premise of Star Trek IV: The Voyage Home seems far too absurd to work. The crew of the Enterprise traveling back in time to present-day San Francisco to save humpback whales sounds like a ridiculous idea that jumps the shark. But it works beautifully, because the cast fully commits to the comedic implications of the premise, and the quest to save the whales is used to explore the importance of conservation and protecting the environment.

The Voyage Home is easily the lightest Star Trek movie of the bunch, but it’s also the funniest, and Star Trek Into Darkness proved that dark Star Trek movies don’t really work. Framing it as a comedy was a bold move, but the humor is wildly entertaining (perhaps even more entertaining than the space warfare that should be in its place).

RELATED: William Shatner Reveals Why He Has Never Watched 'Star Trek'

The Star Trek movie franchise has explored some pretty wild ideas. In Star Trek III, Kirk dabbles in resurrection. In Star Trek V, the Enterprise goes out looking for God in space. In the 2009 reboot, Chris Pine’s Kirk meets Leonard Nimoy’s Spock to establish a whole new timeline. But Star Trek IV’s cocktail of time travel, San Francisco, and humpback whales has to make it the Trek movie with the wackiest premise.

Kirk and Spock in Star Trek IV The Voyage Home

The fish-out-of-water aspect is kind of genius. Fans had been immersed in the high-tech distant future that these characters inhabit for years, so there was a lot of juicy potential in dropping them in the present day for a culture-clash comedy. The movie realizes that potential with a series of classic gags that make use of the cast’s rarely seen comic timing abilities by thrusting their 23rd-century characters into everyday situations that are completely alien to them.

The movie’s refusal to conform to Trek traditions is exactly what makes it such a success. Gene Roddenberry’s episodic adventures in The Original Series went to some really zany, trippy places. In season 1’s “The City on the Edge of Forever,” a drugged-up Bones goes back in time to New York in the 1930s and starts altering the course of human history, and that’s been praised as one of Star Trek’s strongest episodes. Usually, in Star Trek lore, the wilder an idea, the better. Unfortunately, the series’ big-screen output is another story. It’s easy to experiment with goofy, out-there ideas in television, but movie studios get very antsy when hundreds of millions of dollars are at stake and they desperately need to get butts in seats.

As a result, a lot of Star Trek movies fall into a familiar formula: the Enterprise is threatened by some evil megalomaniac bent on destroying Earth (or something equally catastrophic) and the crew manages to stop them in the nick of time. Paramount executives seemed to settle into this formula when it became clear that The Wrath of Khan had been unanimously selected by Trekkies as the best Star Trek movie, but the success of Wrath of Khan isn’t imitable. Wrath of Khan only worked so well because Ricardo Montalbán made the title character one of the most memorable villains of all time.

Shallowly borrowing The Wrath of Khan’s “The Enterprise faces its worst foe yet!” premise every time will make for a perfectly satisfying sci-fi actioner, but the whole point of Star Trek is to dig deeper and ponder life’s biggest questions and boldly go where no one has gone before. Transplanting Kirk and co. into modern-day California might have been weird, but it was also unique and original, and a lot more interesting than Nemesis, Generations, and Insurrection combined.

Scotty and Bones in Star Trek IV The Voyage Home

Being less focused on the wider Star Trek universe and instead dropping the iconic characters into a familiar contemporary setting made The Voyage Home more accessible to casual viewers than the average Trek movie. It tends to be impossible to please both. Generally, a Star Trek movie that appeals to hardcore Trekkies will alienate non-Trekkies, while one that appeals to a wide audience that wouldn’t know a tribble from a Talosian would be dismissed by Trekkies as a watered-down take on Roddenberry’s masterpiece. Against all odds, The Voyage Home managed to use its quirky premise to find the right balance between pleasing the two camps.

Director Leonard Nimoy used the absence of special effects-laden space battles to highlight the interpersonal relationships between the crew. From Kirk’s sweet but doomed romantic arc to Walter Koenig’s “nuclear wessels” delivery to the unexpected but more than welcome union of Scotty, Bones, and Sulu as a bickering trio, Nimoy gave himself and his co-stars a chance to really act.

While The Wrath of Khan is undeniably the best Star Trek movie and The Voyage Home isn’t without its problems, it is pretty astounding that this movie works so well. Considering all the elements at play, it should’ve been a sure-fire failure. But thanks to its poignant environmentalist message, fish-out-of-water humor, and flagrant disregard for the franchise’s well-worn traditions, The Voyage Home is one of the greatest entries in the Star Trek canon.

MORE: Thor: Ragnarok Proves Taika Waititi Would Direct A Great Star Trek Movie