Espionage represents efforts to gather intelligence about a specific race. Espionage builds up over time, and can sometimes lead to theft of technology. The more credits spent on espionage, the faster the buildup effect. The espionage level can be set on the "Relations" tab on the Foreign Policy screen.
Note about tech stealing: at each level, the chance of the espionaging race stealing the tech from the being espionaged race is higher, though the exact figure is not known. tech stealing is possible throughout all levels of espionage and not restricted to a specific level. let me underline one thing, technology theft in espionage is dependent on "chance", not how high your espionage with a specific civilization is.
Train your own agents to nullify enemy agents as they plant themselves in your planet or build counter espionage improvement to prevent the enemy agents from planting themselves in your planet.
Technology theft by the opposing civilization is displayed at the end of the game, but that technology theft display is inclusive of the technologies that are stolen from the planetary invasion. the actual technology theft through espionage can only be traced through turn by turn by differentiating the difference in technology in common(there is a tab beneath the head image, when you speak with a foreign civilization for tech trade) in the foreign trade window. needless to say, it is very tedious, thus i wouldn't recommand anyone doing it.