Spies are paid in bronze. To ensure that a spy is successful, the player must pay his spy more bronze than is available in the target village. If you pay your spy enough bronze, it will be used up. If the target village has more bronze than the spy, the spy will be caught and the bronze is lost.
If successful, a spy delivers a detailed report on the buildings (incl. upgrades), defensive units (incl. those from other villages), and stored resources. However, a spy will not see any warriors currently not in the village, such as those on a mission.
In order to successfully stop a spy spying on your village, you must have the same amount or more bronze in the village than the spy has been paid. If this is the case, then that amount of bronze will be used up in capturing the spy. If there is not enough bronze in the village, the spy will go undetected and you will not know about it.