When Bank A transfers money to Bank B, it usually does through in Bank C. The exception would be when Bank A is a client of Bank B. Then it would just move money out of its own account and into Bank B's account. Both banks have to have a relationship with Bank C that causes them to trust it. If Bank A is a client of Bank B, presumably it has already overcome the trust-related hurdles.
There may be a chain of banks involved as well. Bank A trusts Bank C but Bank B does not bank there, but they do bank at Bank E. Bank C does not have a relationship with Bank E but both share a relationship with Bank D, that is trusted by both.
There are multiple networks of competing correspondent banks throughout the world. For example, in the United States, credit unions are not banks and are required by law to maintain balances at national banks. Indeed, when you write a check on a credit union, you are really writing a check on some bank somewhere else via the credit union's bank account.
There are really two types of relationships in correspondent banking. There are official relationships, such as the Federal Reserve clearing checks for national banks and other member institutions, and there are private clearing relationships. It may be faster or a lower cost for banks in a region to have a private clearing arrangement that bypasses the official governmental clearing arrangement.
In the official case, the central bank formally inspects each bank via legal powers and actually walking in and inspecting the place at their premises. In the private correspondent case, they can do additional arrangements beyond those legally required such as a private inspection, plus they can free-ride on the government's inspection.
Wars are a special case. War powers are usually stated in the legal system. For example, under US law, because of Russia's invasion of Ukraine as well as its threat of nuclear war, existing law permits the President to seize without due process all Russian government assets.
Under the US constitution, people, including foreigners have due process rights but governments do not. They are not people under US constitutional law.
So Russian banks that are not owned by the state, retain their property rights though the assets may be frozen. State-owned property can be seized, sold, and even given to Ukraine.
In the case of war, the question is not trust but war powers. If Bank A is in a country that is at war with Bank B's country, it is unwise to keep deposits in Bank B. The mistake Russia made with respect to the invasion of Ukraine regarding its banking assets was that it failed to understand western contract law. There were many intelligence failures on the Russian side and the banking rules were clearly part of it.
The problem Russia would have had, however, is that to protect its assets from seizure, it would have had to have removed all of them from western institutions. That would have been a giant signal that a war was imminent. Most likely, Ukrainian banks have deposits in Russia that they cannot access. It would be surprising if they did not have correspondent relationships because they share a border.
However, in that case, it isn't so much the correspondent that you need to trust so much as the government on the other side of the border.