Vision

Vision determines how far a unit can see from its current location, your line of sight is affected by elevation and trees - The only exception to this rule are flying units who have unrestricted vision, and Night Stalker with an Aghanim's Scepter.

Fog of War
All areas outside of friendly vision becomes Fog of War, non-friendly units within the Fog of War cannot be seen or targeted (It is effectively Invisibility), however they can still be hit by non-targeted spells, to reveal these units a friendly unit must gain vision in that area.

Elevation and Trees
Units cannot see up elevated areas but units on elevated ground have increased view distance. Any ranged units firing uphill have 25% chance to miss. Trees block all vision and can be used to escape enemies (Known as "Juking").

Day and Night
Most units have different vision ranges for the day and the night, with their day value usually being a lot higher then their night value. Most heroes have 1800 day vision and 800 night vision, but there are exceptions.

True Sight
True sight allows units the ability to see invisible units. There are several ways for a Hero to obtain true sight: + Necronomicon Warrior (level 3)
 * Gem of True Sight
 * Sentry Wards

The following buildings also have true sight:
 * Towers
 * Ancients