Horse sex! If you’re caught up on “Silicon Valley,” HBO’s comic guide to the latest tech bubble, you know about a new entry in the corporate-intimidation playbook: forcing a recalcitrant employee to watch thoroughbreds mate. Such is the punishment of Richard Hendricks, the meek engineer-founder of the data-compression startup Pied Piper. At the end of the second season, Richard is booted by his investors from the C.E.O. seat; now, as the third season begins, he has been replaced with the middle-aged, horse-breeding, folksy-seeming “Action Jack” Barker, and moved to a technical role. In last Sunday’s episode, the sales team tells Richard that Jack has gutted his product in the name of future revenue, and Richard storms off to confront Jack, who’s out at the local stables. “Excuse me,” he yells, upon entering the barn. “Oh, mother of God.” There’s Jack with his arms crossed, and there’s a muscular white stallion, rubbing his cricket bat of a penis against the haunch of Jack’s “No. 1 breeding mare,” as the aggrieved brown horse is described. “Thoroughbreds,” Jack sighs.

Since “Silicon Valley” débuted, in 2014, its creators have not shied away from discussing their consultations with real tech employees to render the Valley with accuracy. The show’s humor derives from its candor about the slog toward three-comma riches: everyone is on a spectrum, claims to be bettering the world, drives a Chevy Volt. Yet if the stables seem a fitting backdrop for an altercation between Richard and Jack—and they do—it’s for metaphorical reasons. As the only full-on sex act so far in “Silicon Valley,” it represents the consummation of a demeaning partnership, the financial one between all-business Jack and idealistic Richard. Also noteworthy: the sex is straight, in a show that until now has been very, very gay.

“Silicon Valley” asks what happens to a generation of straight dudes who are surrounded only by other straight dudes and try their hardest to produce a brainchild. The result, at least in the early phases of Piped Piper, is a kind of communitarian gay paradise. Even after it is funded, the startup seems to have only three female employees: Jack’s two secretaries and a saleswoman (who calls herself “Jan the Man”). This is hardly surprising, when about seventy per cent of tech employees in the real Silicon Valley are men. But it is intriguing that the men understand their work in terms of reproductive potential. (“Me and my product feel pretty fucking compromised right now,” Richard tells Jack in the stables.) As Andrew Sullivan wrote in “Virtually Normal,” his 1995 book about homosexuality, those with a “literal inability to have children” tend to possess “an extraordinary desire to beget figurative children: in the teaching professions, the arts, the military, political and intellectual life, areas where the talents of a person freed from genetic family obligations can be used to enrich the social family at large—especially its future generations.”

Sullivan could be summarizing the ethos of Silicon Valley, where straight men mature alongside the startups that they parent together. The first season of the HBO series is an account of tech pubescence, that time of life when programmers, gawky but ambitious, figure out how to wield their power or prowess. The four original employees of Pied Piper meet while living together in a misbegotten “incubator,” run out of a Palo Alto ranch house by Erlich Bachman, a lion-maned has-been entrepreneur. Their collaboration blooms in this sublimated gay setting. When Dinesh, the Pakistani-born coder, gets a hard-on, it’s not for the woman who has asked him up to her hotel room but for a script that is displayed on her laptop—to the coder’s great shame, it turns out to be the work of his brogrammer buddy Gilfoyle. After a setback at the startup tournament TechCrunch Disrupt, the boys return to their hotel and cheer themselves up by working out the most efficient way to administer hand jobs to every audience member. At first they’re just joking around, filling a whiteboard with exuberant red formulae and phalli, but then Richard finds himself so inspired that he runs next door to write the code for a groundbreaking algorithm called “middle-out,” which gives Pied Piper its funding legs. The incubator works.

Although the men of “Silicon Valley” are obsessed with “dick,” the word doesn’t have much to do with sex, because no one is having any. The term means something more like “talent.” In season two—mating season—Richard’s off to market, and Erlich gives him a pep talk as they sit in the waiting room of a venture-capital firm: “We’re walking in there with three-foot cocks covered in Elvis dust.” The men know their worth and must find the investor who recognizes it. But, inside the boardroom, a lineup of four partners greets Richard’s presentation with stony silence. Then the schlumpiest one pipes up, to suggest that Richard revise his pitch. Richard demurs, sputtering, “I’m a three-foot dick! I’m covered in dust!” Richard’s outburst prompts a competitive offer and a bidding war, which Erlich masterminds in father-figure fashion, driving up Richard’s price by humiliating a phalanx of moneyed suitors—this one for the shirt his wife picked out, that one for being “the human equivalent of a flaccid penis.” These displays are meant to demonstrate the size of Richard’s creative promise, which might be called his dowry. In Erlich’s final act, as he later describes it, “I pushed my dick to the side, unbuttoned the bottom two buttons, and bam!” (“Bam” stands for “put my balls on the table”—thankfully, an off-screen act.) At the end of the second season, funding is secured.

Finally, there are the marriage-contract details. In the third-season première, which aired April 24th, Richard has been thinking of leaving his company rather than accepting a diminished role, but he agrees to visit Jack at his Mission-style mansion. There he’s welcomed onto the veranda, which overlooks a small vineyard, and offered a glass of iced tea. Jack—Barney-like with his bald head and purple Oxford shirt—listens attentively as Richard asks, “Can I really be expected to do my best work when I am constantly feeling undervalued at the company that I started? Does that make sense?” Jack bites his lip in sympathy. “I appreciate your position. So—I guess we just won’t do it!” Richard, who had been warming up to Jack, seems confused: “You’re not going to take the job?” Jack shakes his head. “Without you handling the tech, I don’t see how this company works.” Hard to get, as usual, gets the guy: the episode closes with Richard leaving the property, then doubling back.

With that, the men of Pied Piper are bound to Jack, and their little gay commune unravels. There’s nothing particularly gay about selling out, but there’s something quite gay about the world that the Pied Piper guys have lost—in which men can admire each other, collaborate, and create. Success in Silicon Valley beckons a ruthless new era. On the plus side, there’s unlimited tech gear and jello-infused watermelon slices from Chef Amy; in the minus column, the evisceration of camaraderie and joy. Hopefully they’ll use the leftover funds to hire some more women.