Technically, both.
Light sources (units, items, objects, fire) have a defined power. This can be 0 to 15.
The light power of any particular light source falls by one with each transparent ortogonal tile of distance from that light source.
Any tile is lit with the greatest light power shining on it from any particular source. Ambient lighting has constant power through the map.
By default (this can be changed by "maxDarknessToSeeUnits" setting) any unit on standing on a tile lit with 9+ light is considered lit. Otherwise, the unit is considered shaded. There is no in-between state.
Units (or more precisely, armors) each have a set distance at which they see lit units and a set distance at which they see shaded units.