The range overlay shows all active range queries (these queries are always run and warn the source when an entity came in or out the range).
For units, this range query is their vision range, as when something passes in their vision range, they can react to it and come closer to attack. Only in stand-ground mode, the range is the attack range I'd guess.
For buildings, the range is always the attack range, as the building's can't move, so they don't have to look further than the attack range.