Building used to increase the scan range to detect further colonies and incomming fleets. Any planet with scanners built upon it is marked with a gold [S] in the planet frame and planet lists.
Scanners allow you to keep an eye on the planets close to your borders. Fleets are only allowed to travel inside the scanners range, so you need to build scanners at your borders to expand your empire.
If enough are built, you will see into the territory of your rivals. This allows you to identify colonies belonging to your opponents and attacking them. In a war, you may need to build more scanners at your borders to detect planets that are further into enemy territory. Alternatively, you could conquer enemy planets containing scanners, depriving them of the benefits and instead put them to your own use.
The effect of scanners on fog of war are shared among players of the same empire and among allied empires, allowing you to see what your allies see.
Colonies will detect incoming fleets. The time before the fleet arrive to the planet for detection depends on the size of the fleet (or if there are several incoming fleets, the sum of the size of all fleets, no matter if they come from different planets and arrive at different times) and the effective scan range of that planet. The more scanners, the sooner you will detect the incomming fleets. Scanners will multiply the standard detection time (colony with no effective scan range) by 1 + scanners / 100.
Any planet within scan range will benefit from the added detection time but the effect will degrade with distance from the scanner source. You can check the effective scan range of every colony in the "build scanners" screen.
On the "Combat" screen/"Scanners detection" option you will find a list of scanners around your planets. You should check this screen very often because near scanners are a threat for your empire. If your borders are clear of enemy scanners your empire will be safe.