This is naive pathfinding that adopts the shortcut of perfect information. Good looking pathfinding simulates realistic terrain ignorance (no "psychic powers"), but it is likely to be expensive enough to require other compromises (e.g. updating paths less often).
You reckon the perfect information version is cheaper than an algorithm that works only on the tiles near to the unit? But this quickly gets too complicated to discuss; there's the confusing matter of precalculation versus live updating.