Knowing who to spy on is just as important as teaching your case officers how to spy. Sometimes deciding who to keeps tabs on, or steal information from, can mean the difference between a successful operation and a ruined reputation that makes others unwilling to work with you.
Depending on the country and the circumstances, it is sometimes easy for a nation to decide who they should be spying on and stealing secrets from. Warfare between actual nations often makes the spy game less murky. When two nations go to war, they both spy on each other to get an edge on the battlefield, figure out what the other is thinking, and obtain information on each other's weapons, tactics, and logistics matters. Israel was, and to some degree still is, in this position prior to the Six Day War in 1967. Israel, surrounded by hostile states and facing what it thought was imminent attack, was able to win, in large part, because of their massive network of informants and spies in Arab countries. Information gained from those spies, recruited by the Mossad and Military Intelligence (AMAN), made the difference. In those days, at war with every country neighboring it, Israel's intelligence mission was simple and straightforward: know everything there is to know about how Arab militaries work. While the Egyptian and Syrian secret services spied on their own people, Israel's leaders knew more about Arab military capabilities than the Arabs themselves. One such spy, Eli Cohen, was so effective at infiltrating and gaining the trust of the Syrian government that he was given a tour of the Syrian fortifications on the Golan Heights. The later result was complete devastation of these fortifications by the attacking Israeli forces.
The same thing happened for the US during World War II. During the war, Japan and Germany provided very clear-cut, unambiguous enemies towards which Allied espionage efforts were aimed. The U.S. Office of Strategic Services (OSS) and the Allied Intelligence Bureau (AIB) led the way. The AIB was a joint intelligence operation run by the British, Dutch, Australian and American spooks in the Pacific campaign. Like the OSS, the AIB ran special operations, but it also operated networks of spies and signals intelligence collectors behind Japanese lines. AIB was a tremendous success and is often seen as a historical model for running a successful intelligence service.
Compared to espionage during wartime, peacetime, and especially non-conventional conflicts, presents situations that are infinitely more difficult. Deciding who to watch is a much trickier decision. Ideally, the mission of civilian intelligence agencies is streamlined: spying on countries hostile to you, spying on terrorists, recruiting informants, and electronically eavesdropping on those types of people. However, even regions of the world that see a great deal of conflict, rarely see conventional warfare anymore. For example, the last major land engagement between Israeli and Arab forces in the Middle East was 29 years ago in Lebanon.
While spying on one's enemies is easy, it's the other issues that often trip up intelligence services. These include things like spying on allies, spying on neutral countries, spying in order to steal military technology (especially if it's a friendly nation that possesses it). These are extremely difficult decisions to make since, ideally, the object of spying is to collect information that further the country's national security or foreign interests. The problem is that this "definitions" of an intelligence agency's purpose is too broad. A case in point is Israeli espionage against France. Needing a powerful air force to protect itself against attack, Israel had requested that Dassault Aviation produce the Mirage 5 in order to beef up its air combat capabilities. The 50 aircraft paid for by the Israelis were built, but in 1967, the French government imposed an arms embargo on Israel, preventing the aircraft from being delivered. Instead of crying about it, the Israelis simply produced an unlicensed version of the Mirage by using industrial espionage against the French to steal the technical specifications concerning the engine and the airframe. Technically, while the French government was behaving antagonistically, France was neither at war with Israel nor was the nation considered inherently hostile the way Syria and Egypt were at the time. Nonetheless, the Israelis saw something they needed, and had no qualms about stealing it.
The important thing that nations have to keep in mind, and citizens often become irritated about when their secret services screw up or don't have the right priorities, is just how much intelligence costs. For one thing, depending on the country, training one case officer or field operative can require years of effort and millions of dollars. In Israel, it takes about two years to fully train a Mossad katsa, with the recruit being required to learn covert entry (burglary), foot and vehicle surveillance/counter-surveillance, how to approach potential agents for recruitment, Arab culture and info on the militaries and security services of the Arab world, report writing, and covert communications. Operatives also have to be taught how to defend themselves with pistols, requiring an intensive crash course is how to fight with a handgun in all kinds of settings, like in a car or sitting down in a restaurant. Firearms training is more important for Israeli operatives than in other countries since Israel is in a continuous state of war and thus their operators are at more risk for being ambushed while meeting a contact.
None of this is cheap in the least. Furthermore, espionage itself is an extremely expensive game. Lots of agents are bribed for the information they provide, and the better the intelligence provided, the higher the price, with some highly placed agents making thousands of dollars per item they deliver. Lots of introductions and recruitments take place in restaurant or bar-type settings, with the case officer picking up the tab (another psychological tactic for befriending potential agents). Finally, equipment such as bugging devices, counterbugging devices, specialized vehicles, forged passports and documents, standard-issue handguns, and a multitude of other items are not cheap either, as they often have to be specially developed by technicians in an in-house "spygear" department.
In the end, you have a very, very expensive group of spies from whom taxpayers and citizens want results. Some people think that intelligence agencies should only operate against terrorist groups and hostile countries. Unfortunately, it's not that simple. In order for political and military leaders to have the "big picture", it's necessary to spy on everyone, even your friends. After all, an allied country might have some military technology you need, but won't sell it to you. A country might not officially be an enemy, or even potentially hostile, but they might be selling weapons to others countries that are. Also, it can be difficult in an age of terrorism and insurgency to know when major attacks are going to occur. As the Israelis learned long ago, espionage is an all or nothing game. To survive, you spy on everybody, even your friends.