The fairly short answer is:
1) Race-wide spies develop general info that you can see in the "report" box, ship destinations, and such, and are immune to being eliminated. Info accumulates, but the number of spies (up to 4) make a difference in the max possible intel level.
2) Tile-placed spies stop the improvement from generating anything except its maintenance cost and also have some slight chance of gaining the theft of some technology ffrom the race. The tile-placed spy's effects last only as long as the spy is there (and not removed by the player or nullified by the opponent).
Also, apparently the probability of stealing a tech is independent of the number of tile-based spies. IOW, one spy has the same chance as 25 each turn.