In the context of war, any fighters need to be members of the armed forces of a participating country.
Many armed forces use contract mercenaries, being fighters who are not part of a participating country's armed forces, but on the payroll of an external company. The problem with this arrangement is that it allows countries to have a level of deniability or lack of accountability for war crimes committed by those mercenaries. All fighters for a country must be on equal footing legally and the sole responsibility of the country.
We can easily see that mercenaries can operate outside the legal framework of the countries that hire them by noting how, despite desertion in Russia being punishable by a sentence of 10 years and private military companies being officially forbidden, the Wagner Group head, Yevgeny Prigozhin, publicly told the Russian prisoners he was trying to recruit to be cannon fodder for their forces in Ukraine that they would be shot if they deserted.
If a fighter is not the sole responsibility of a country, they are effectively committing murder or other crimes without the responsibility for them. Countries need to be held responsible for all atrocities committed by those fighting for them, but having arms-length fighters partially absolves them of that responsibility. There must be no ability to claim that training by another country or a corporation as an excuse.
The main problem with mercenaries is that their loyalty is not to the country that engages their employer. That makes them a risk to that country's security, especially if their employer is supplying forces to allies of the country's enemy or even to their enemy. Then there is the political stance of the companies that may be at odds with their hiring countries, perhaps leading to compromised missions. Pervasive use of mercenaries as the main agents in war zones is undermining the sovereignty of nations because they are not beholden to any nation.
We saw all this disloyalty play out when the Wagner Group took over military control of parts of Russia on their way to Moscow to challenge the leaders of Russia's military over their handling of the invasion of Ukraine. Wagner, along with other Russian-backed mercenary groups, have been responsible for many atrocities in Ukraine and other parts of the world.
Personnel that belong to other countries that are a part of a UN-sponsored peace-keeping force will be operating under UN command which takes responsibility for their conduct. Such forces will be operating under the rules of the UN charter by which they are allowed to be in the troubled countries.
Too often are companies and countries absolving themselves of the problems created by contractors who are not bound by the obligations their hirers are under. Sanctioned killing and other martial actions must always be under the sole responsibilities of a government. Those governments can then be held solely responsible for any untoward actions taken in their name, without having to deal separately with third-party contractors. The responsibility for any violations of the rules of engagement are then clear.
The civilian counterpart to this is consultancies that are hired to do exclusive work for a government, but then use information obtained through that work to help their other clients. PwC anyone? While there are situations that need some independence, most of such contracts should rightfully be done by public servants following due process. Even the work requiring independence can be done by statutory bodies, as the many anti-corruption commissions are.
All these contractors are part of a concerted effort to undermine trust in governments and the public service by weakening their experience base, when the proper course of action is to further separate the public service from political interference. Contractors end up costing more, skew lines of accountability and responsibility, and have shown that they cannot be trusted to properly carry out their assignments. There are things that governments should be directly responsible for and should have the experience and skill to do it, free of ideological meddling.