John P. Johnson / HBO

In the penultimate episode of Silicon Valley’s second season, the Internet startup Pied Piper finally got its big break. The company’s video-compression software had been boxed out at every turn by its moneyed competitors, and its one contract, a live-stream of a nest of condor eggs, had attracted no viewers. That is, until a museum worker arrived to remove an unhatched egg, fell, and grievously wounded himself on-camera, instantly turning the live-stream into a worldwide online event. Silicon Valley, which ends its second season Sunday, is a comedy first, but a dark indictment of an industry as a close second—one that never lets its viewers take for granted why they’re laughing.

The cleverest thing about Silicon Valley’s satire is that the show presents its central plot as a seemingly straightforward story arc: the path of shy, nervous programmer Richard Hendricks (Thomas Middleditch) to startup superstardom after he creates an algorithm that compresses data with revolutionary ease. Mike Judge’s comedy seems to be taking the audience through the various stages of a nascent tech company’s growth in the Bay Area, from initial venture-capital investments to large-scale hiring. But in Silicon Valley’s second season, Richard’s journey has become a Sisyphean struggle against an evil conglomerate hell bent on blocking him at every turn, and nearly every episode contains a plot twist that turns Richard’s small triumphs against him, whittling his idealism down to nothing.

To recap: This year, Pied Piper attracted handsome investment offers from many venture-capital firms, all of which were withdrawn when the evil tech giant Hooli (clearly modeled on Google and/or Apple) sued the startup for copyright infringement. So Richard turned to the unstable, self-made billionaire Russ Hanneman (Chris Diamantopoulos) for funding, but his meddling only added to Pied Piper’s bad reputation around town. Then another company ripped off Richard’s algorithm. Then Pied Piper lost a chance to win a big contract when Russ rested a bottle of tequila on someone’s delete key during a coding session. Then Hooli won its lawsuit against Pied Piper because Richard tested his software one time on a company computer. And finally, he got his big break—but only because someone might die on camera on one of his live-streams in the finale.

Again, this is supposed to be a comedy. Silicon Valley mines laughs from its well-drawn characters, like the stoned, pigheaded entrepreneur Erlich (T.J. Miller) or the reserved, polite-to-a-fault business adviser Jared (Zach Woods). But like all of Mike Judge’s best work (the film Office Space, or the TV series King of the Hill), the one-liners are just momentary distractions from the creeping truth that the world is a cruel place where only the most ruthless can truly succeed.

Silicon Valley’s approach to plotting can make for a frustrating viewing experience. The Pied Piper programmers typically insult each other and goof off for 25 minutes before another devastating twist arrives. Part of the reason for this is surely that everyone on the show is a coder, and the writers see little dramatic potential in their simply doing their jobs. There’s admittedly not much excitement to be found in watching someone tap furiously at a keyboard, but the nerdy testosterone thrown around by programmers Bertram (Martin Starr) and Dinesh (Kumail Nanjiani) proves to be an amusing substitute.

Even funnier are the show’s glimpses into the internal politics of Hooli, a replication of those geeky programmer wars on a CEO scale. The company’s preening founder Gavin Belson (Matt Ross) wants Pied Piper destroyed not just because it could be a potential rival, but because Richard made the unthinkable choice of refusing his corporate oversight. “I don’t want to live in a world where someone else makes the world a better place than we do,” he tells his executive board in a tone of utmost seriousness.

Richard’s sad but noble choice was trying to strike out on his own, and while testifying on a case he knows he’s doomed to lose, he decries his foolish idealism. “I just wanted to be different,” he said. “The law says that I lose everything, my whole company, everything that I worked for, because I used one Hooli computer to test and modify one block [of code]. To me, if the system says that’s fair, I guess I’m probably not meant to be part of it.” It’s a rare moment of sincerity for such a brutal satire, perfectly delivered by the stuttering Middleditch, and it finally lands the punch Judge has been jabbing with all season. The irony of the tech world’s model of free enterprise, Silicon Valley shows, is that there’s nothing remotely free about it.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.