For example, I'm friends with most of my exes. We're all in new relationships. I sometimes go out for dinner with one of them to catch up on life and talk. There is no sexual tension at all, because we are in different relationships, so sex is not something we even think about!
If we were both single and an ex would call me and ask if I'm alone tonight and if she can drop by and watch a movie, then that would be a completely different situation, and there very likely would be sexual tension. But this is highly situational and has more to do with circumstances than with the people involved.
Just because I had sex with a person in the past or might in the future or could in theory does not mean that there is constant sexual tension between us.
Lot's of friendships start with brief dating/hookup that doesn't lead anywhere romantically. And frequently major relationships leave bonds that persist after the relationship ends. I'd be hard pressed to think of ANYONE I know who does not have at least one friendship like that (I'm early 40s).
And some I hope to someday fool around with!
It's not simple, but the vast majority of the time it is not a problem either. The real problem comes from jealous partners, and I personally would never date someone who is so jealous that they cause problems with my existing friendships.