Espionage is a form of intelligence gathering which involves active penetration of a location where sensitive data is stored. Technically, the term “espionage” is reserved specifically for the gathering of confidential information which will be used to benefit a rival nation, but many people use the term more generally to refer to any sort of clandestine information gathering effort, whether or not it involves rival countries. This form of spying tends to attract daring, aggressive individuals, as people must be bold, quick-thinking, and very intelligent to succeed in spying operations.
The primary distinction between espionage and other forms of intelligence gathering is that it involves actually accessing a site where information is held. There are a number of ways to accomplish this goal, from gaining employment as a legitimate member of an organization to breaking into a facility to steal information. In all cases, the spy must be able to quickly discern which information will be most relevant, and he or she needs tools to record and transmit the information.
Infiltration of organizations is one popular form of espionage, since it ensures a steady flow of information. For the person doing the infiltrating, of course, this can be very dangerous, but the reward is viewed to be worth the risks.
Since espionage involves the removal of confidential and sensitive information, it is, by nature, clandestine. Many governments inform their spies that they are on their own once they manage to enter a facility with restricted information, and agents are given extensive training which allows them to move quickly and ideally without detection to get the information they need. Secret agents are also expected to conceal information about their movements, operations, and employers from other people.
Information obtained via espionage can be of vital importance. Espionage often reveals information about troop movements and other military matters, for example, and it can also shed light on the policies and plans of rival governments. Espionage isn't limited to governments at war with each other, either; even allies may spy on each other, because all nations are well aware that their partners tend to keep their cards close to their chests.