Perhaps you've wondered how reconnaissance satellites take detailed close-up photographs of our home, the Earth. The answer is that they use high-resolution CCD cameras coupled large lenses to take pictures of the ground right below them as they pass over. Pictures taken during poor weather are likely to be filtered out. Even as late as the mid-80s, reconnaissance satellites delivered their pictures back to the Earth using fragile film canisters mounted on parachutes and picked up by planes in mid-air. Today they send back the pictures using encrypted radio transmissions.
Most information about modern-day spy satellites is highly classified. So much f our information about how these devices might work is based on guesses and may be speculative.
One speculative calculation on the performance of spy satellites uses the Rayleigh criterion, a way of calculating the resolution of an optical image. The equation involves sinθ = 1.22 λ/D, where λ is the wavelength of light, θ is the angular resolution, and D is the diameter of the lens or mirror. Assuming a satellite operating in low Earth orbit at about 300km altitude, with a Hubble-sized lens 2.4m across, looking at light of a typical visible wavelength around 550 nm, we get an angular resolution of 229 nanoradians, which, at a 300km altitude, translates to a resolution of about 7cm per pixel. This does not take into account atmospheric occultation or imperfections in the lens, but it seems a fair estimate.
Much to the chagrin of international intelligence communities, commercially available high-resolution color images of the world have recently become available using services such as Google Earth. These commercial services offer resolutions of around 20cm per pixel or better for some areas, likely approaching spy satellites. The primary difference is that pictures on such services tend to be around 1-3 years old, whereas military reconnaissance satellites probably update their images every time they orbit the Earth, which is approximately every 45 minutes. The intelligence difference between the two, is, of course, huge.
Recently, the US-built Mars Reconnaissance Orbiter was deployed in orbit around the Red Planet, returning high-resolution images of that body as well. Google Earth and Google Moon already exist, it's just a matter of time until we start seeing Google Mars and Google Asteroids.