A conversation with some friends recently brought up this point. One friend mentioned that in a game they were in they had the inevitable betrayal from the friendly NPC, and that the GM was a little disappointed everyone saw it coming. I got unasked for kudos in this conversation because it was compared to my game where the friendly NPC betrayal came out more as a surprise, but the friend didn't quite know what the difference was. Having talked about this a few times over the years, I explained that the difference is that in my games 90% of the time or more a friendly NPC is just a friendly NPC, and that I not only make sure to keep the ratio like that, but I take pains to make sure I do.
If Every Day Is A Sunny Day
If every day is a pleasant day, then what is a pleasant day? It's just a normal day. This is the first realization you need to have when GMing. If every NPC the players meet is an enemy, an agent of the enemy, or the tool of an enemy then you don't get to be surprised or disappointed when your players expect the new NPC they met to be one of those things. You can only betray PCs so much, or kidnap their friends/loved ones so often, before it is just expected.
The Players Know They're In A Game
Second, your players know they're playing a game. They know you're telling a story. They know that dramatic events are going to happen. This isn't like a book where with one writer you can have the characters pretend it's not a story but their life, because you have other people controlling those characters. And even if they RP the character without this knowledge, the player themselves still knows. They're expecting betrayal and shenanigans because that is the point of the game: for things to happen.
Don't Have Time To Waste On Unimportant Things
This is the third part of the puzzle here. The weakness of RPGs is that everything is done via explanation. And we only have a limited amount of time with a diverse group of characters. Because of this your time is limited in what to bring up, who to play, and what to call attention to. The players - who know they're in a game - are also aware of that. It's why if you describe details around a piece of scenery more than others, they'll queue in that it is important. The same is true for NPCs. An NPC who gets screen time from the GM's side of things, is an important NPC because otherwise why would they come up?
This then works against you as the GM. Who has time to focus on the PC love interest that is only going to be a love interest and nothing more? They're not going to betray the PC. They're not going to be kidnapped. They're not secretly the BBEG's child. They're just a random NPC that had a liking to the PC and made a play.
The answer to that question is you, the GM. And if you don't have time you need to make time. You need to commit to having 90% of the friendly/helpful NPCs just be friendly/helpful NPCs. Allies who are on the PCs side. People who are pro-the PCs, but maybe not involved in the plot. They don't need tons and tons of time, but they do need time.
This Means Some Campaigns = 0 Betrayal/Kidnappings
The big trick here is also this: even if you keep the 90% ratio, if a key NPC always ends up changing sides or being kidnapped to be used against the PCs they're still going to expect it. If your players rotate out every game, not much you can do. They come in primed like this. If you play multiple games with the same friends group? Good news, you can work on this. It just means that sometimes, for the entire campaign, you leave the NPCs alone. No one changes side. (or if they do they go badguy to good guy and it is not a trap.) No one is kidnapped. No one is a sleeper agent.
You do this, and your players will remember (even if not conciously) that you don't use this trope all the time. You still have the big NPCs in there. You still have the supporting cast. They just play it straight. You break the expectation that it's a game so of course there will be betrayal. You break the expectation that anyone getting regular screen time is going to be plot relevant. You establish a baseline that 90-99% of NPCs are exactly who they say they are...and when you do bring up the person who will do a betrayal, it is set up that it might take the players by surprise.
Why might? Because the players still know its a game. They still expect it. And unless you've established you never do it, they know you will do it sometime.
The Unsought Benefit
There is one other benefit to doing this by the way. Beyond getting your players to not expect betrayal at every corner, when you do this you may also get this other benefit: without always fearing betrayal, but NPCs still getting screen time, the players will feel safer investing time and effort into those NPCs.
And that's just good for everyone.