A detector is a device that captures and measures electromagnetic radiation, such as light, radio waves, or X-rays, to gather information about celestial objects. It plays a crucial role in observational techniques by converting incoming photons into measurable signals, allowing astronomers to analyze the properties and behavior of distant stars, galaxies, and other astronomical phenomena.