Hackers are the new pirates, in more ways than one. First, a history lesson.
From the European discovery of the New World until 1713 (when a treaty was signed) all Spanish-held territories could only trade with Spain on Spanish ships. The other European powers weren’t happy about it, but for the most part they lacked the firepower to go toe-to-toe with the Spanish. Even Britain’s vaunted Royal Navy wasn’t up to the task until the early 1700s, when Spain’s military had weakened.
Lacking the ability to directly attack Spain, the other European powers landed on pirates. They allowed criminals (pirates) the ability to operate in their ports, sometimes with a legal fig leaf of a “Letter of Marque” making them privateers, sometimes not, as long as they attacked Spain. This was even more beneficial to the host country in that pirates were self-funding and successful pirates were an economic stimulus. (Somebody had to drink all that rum.)
Now, we see nations such as Russia allowing hackers to operate inside their borders as long as the target of the activity is directed at foreigners. Not only does Russia allow these hackers to operate, but if and when said hacker gets politically or militarily useful information, Russian intelligence will grab it and run with it. This may include monkeying with US elections.
There is nothing new under the sun.