Counter-intelligence is the act of seeking to oppose the activities of spies and similar enemies. Major nations have organizations which perform this role. Methods include surveillance of suspects and their communications, undercover agents, monitoring the behavior of legally accredited diplomatic personnel (some of whom are sometimes actually spies or...
Counter-intelligence
Espionage is the practice of obtaining secrets (spying) from rivals or enemies for military, political, or economic advantage.
Espionage, when performed by a citizen of the target state, is generally considered to be a form of treason.
For example, espionage is still a capital crime in the USA; however, the death penalty is rarely used in espionage cases in the U.S. See Espionage Act.