There are clusters of galaxies, and the space between them is filled with hot gas, which can only be seen as X-rays or gamma rays.
When measuring how much gas there is between those galaxies, scientists realized that the material should be around five times what can be detected. That undetected matter is known as dark matter.