Clarke’s 3rd Law states “Any sufficiently advanced technology is indistinguishable from magic.” That is a good way to describe what happens in science fiction stories, but I also see this a lot in fantasy stories. They treat magic as something as reliable as science. As long as you say the right words, make the right gestures and use the right ingredients, then your spell will work correctly every single time. If the magic doesn’t work, it is because the user fucked up.
This is the magic of Harry Potter, the Doctor Strange movie and fantasy erotica stories where wizards create hot tubs to have sex in. It is a perfectly acceptable way to do magic in your stories. In fact, most people recommend this as a consistent universe is something the reader needs in order to engage with your world.
(Fun aside, this includes the movie, Weird Science, where two horny teens hook up a doll and some porn to a computer and somehow get a hot woman with super-powers to help them out. That sure as fuck wasn’t science. That was a magic ritual. This changes nothing in the story, which shows you how interchangeable science fiction and magic can be.)
Another kind of magic is more like a relationship between the magic user and the forces they manipulate. The spell works because the caster has immersed themselves in the power they are calling on, or they perform tasks and sacrifices that the magical forces demand. In order to call down the lightning, the lightning has to like you first.
This is the magic of voodoo, the Doctor Strange of the 70’s comic, and the novel, Jonathan Strange & Mr Norrell. This kind of magic complicates things as every spell turns into a negotiation. You don’t just summon a bird to do your bidding, you borrow one of the Raven King’s minions and woe to you if you mistreat it.
Personally, I find the second kind more suitable for erotica. All sex is a relationship, and the better kinds of stories recognize that. If you are going to add magic to sex, why not take the opportunity to explore that relationship as well?
In order to call down the lightning, not only do you have to get the lightning to like you first, but then you need to seduce, sweet talk or bribe it. What does lightning want? Does it want a kiss? Does it like nipples? Does it enjoy watching? Answering those questions can lead to fun developments, like an elemental threesome.