Espionage is often part of an institutional effort by a government or commercial concern. However, the term tends to be associated with state spying on potential or actual enemies for military purposes. Spying involving corporations is known as industrial espionage.
One of the most effective ways to gather data and information about the enemy (or potential enemy) is by infiltrating the enemy's ranks. This is the job of the spy (espionage agent). Spies can return all sorts of information concerning the size and strength of enemy forces. They can also find dissidents within the enemy's forces and influence them to defect. In times of crisis, spies steal technology and sabotage the enemy in various ways. Counterintelligence is the practice of various means of thwarting enemy espionage and intelligence-gathering. Almost all nations have strict laws concerning espionage and the penalty for being caught is often severe. However, the benefits gained through espionage are often great that most governments and many large corporations make use of it to varying degrees.
Different intelligence services value certain intelligence collection techniques over others. The former Soviet Union, for example, preferred human sources over research in open sources, while the United States has tended to emphasize technological methods such as SIGINT and IMINT. Both Soviet political (KGB) and military intelligence (GRU) officers were judged by the number of agents they recruited.