In addition to the ones in the OP, some other ideas that can be used alone or together to form your back story...
Friends in High Places
If country B has friends in counties C, D, E,.., then perhaps they can form a mutual defense pact, like NATO. This could happen for a number of reasons, including inter-marriage between B's nobility and those other nations' noble families, a shared religion, active diplomacy on B's part...
Technological superiority
Maybe B has some huge technological advantage. This might provide them with superior weapons, as you mention. Or maybe it just means they have all the cool [your world's equivalent of the next iPhone] that everyone wants. If A invades B, then those industries are at risk and might be destroyed. Therefore the citizens of A are not in favor of invasion.
Hearts and Minds
Maybe B has a great many artists who export great works of art (writers, painters, musicians, etc.) or maybe they're just good at public relations. Either way, they've tapped into something in the hearts of A's citizens. Because of this, A would find a war with B to be very unpopular with those citizens.
Raw materials or Goods
Maybe B is the only place where you can find some valuable resource everyone else wants. This could be a manufactured good, an expensive wine, gold, silver, jewels. Or it could be a combination. But whatever "it" is, B is the place to get it. B exports it. B therefore can threaten to cut off supplies to A and anyone else, should war break out. This makes war a risky endeavor.
Friends in Low Places
Maybe B is the base territory for major crime syndicate(s). The mafia who are the crime bosses in A are all immigrants or descendants of immigrants from B. Therefore, they've let it be known that if war breaks out, they'll make things hard. Riots, crime waves, publicly exposing the dirty little secrets of the ruling class, or cutting off drug supplies. These are the kinds of things that can trigger social unrest or revolution if they get bad enough. So maybe the threat is so severe that the ruling class of A takes it seriously.
Bribes
B flat out bribes enough of A's ruling class to prevent outright war. It's expensive. It's risky. But it works. Oh, sure. They're called "loans." But when the loan keeps being forgiven, it's a bribe in all but name.
Puppets
Maybe B started out bribing or blackmailing A or loaning money to A (your Money example) or whatever. But over the years the power dynamic has shifted to the point that A has, quietly, patiently, covertly, supplanted some percentage of A's ruling class with either outright puppets or with sympathetic rulers. This is the long game. It's also highly risky. But if they can slowly get people "on the inside" then over a few generations, they can try to take over enough of the ruling class to stall any vote for war. Maybe not a majority (yet) of the A's Senate is owned, but enough that a vote for war will fail. And maybe the plan is to turn A into an outright puppet in a few more generations.
Marriage
Europe's history is filled with alliances and partnerships made through marriages. B works diligently to marry their noble children with A's noble children until any war would mean a war with family. (This can also be the opening moves to "puppet" above.)
The enemy of my enemy
Maybe B works ever so quietly to convince A to instead hate on C. Or convinces C that they need to go to war with A. Working to push the countries in either direction -- or pushing both in that direction at the same time -- means that now A has a reason to hate someone else more than they hate B. As long as A doesn't suspect B's involvement, then they will probably ignore B for the duration of their hostilities with C and maybe beyond.
Quid pro quo
Maybe B offers to help A with some problem they face. This can work in tandem with "enemy of my enemy." But by helping A, they defuse their hate towards B. And/or make A indebted to B either literally with war loans or figuratively with "hey, you owe me a favor since I helped you out with that thing that time...")