~Waits for the earworm to take root~
In fiction, much like real life, sex typically happens as an evolution of romance, a demonstration of power, an act of manipulation, or an emotional balm. Whether the sex is graphically detailed, faded to black, or a two-sentence spurt depends on myriad factors rolling around the author's head.
For my books, sex of any flavor comes down to whether it suits the character in "this" moment of their story. It's entirely possible that where the reader enters the character's life does not coincide with a sexually active time for the character. Sex shouldn't be shoehorned into a story any more than it should be actively avoided. Similarly, don't confuse intimacy with sliding Tab A into Slot B. Sex isn't a foregone conclusion in every intimate relationship, nor does sex require there to be a healthy relationship before/during/after it happens. However, unlike real life, sex in a novel needs to serve a purpose, to "show" something about a character and that character's relationship to their world.
When it comes to my protags, a critical part of their character development involves establishing and managing intimacy. Whether that intimacy leads to romance or to uncommon friendship depends on the protag. Since I write series rather than stand-alones, building intimacy takes place over multiple books. The question of sexual desire is answered fairly early. If sex is in the protag's future, then, sure, flirting happens. Sure, there will be caresses when merited. A toe-curling kiss may happen in book 3, but that's no guarantee that beds will be breaking in book 4.
In my High Fantasy series, my protagonist understands the primal drive of intercourse, but she views the act with something close to disdain or contempt. Her history is rife with copulation equating to manipulation or worse. She's not the sort of gal for whom sex is the ultimate demonstration of a soul-deep connection. The only sex described in detail in that series is when the protag happens upon others in the throes.
In my Urban Fantasy series, my protag is hardly sex-averse, but her focus isn't on getting laid. Her last two girlfriends ended up maimed by greater powers, so she's not keen to put someone else on the chopping block. However, there is a romance (re)building between her and another series regular. Crafting that intimacy takes priority over the boinking. Yes, I do hear from readers that "the story was good, but I want sex in my UF books and this didn't have any so I won't continue with the series." That's cool. There's a good chunk of the UF genre that offers high-octane sexual experiences. No harm, no foul. Hell, I'll offer recommendations.
Since I don't write romances (well, not that I've published) a romantic plotline is not the primary plotline; therefore, I can't have sex detract from nor dictate the main plot. The quest for intimacy, on the other hand, provides motivation for the protag. It is integral to the story. And that, I lay out in great detail.