Current as of April 21, 2014 (M36)
At boot, the panel backlight's brightness is set to 40% (computed linearly) of its maximum level by the boot-splash Upstart job. This happens before the boot splash animation is displayed via the ply-image command.
After powerd starts, it chooses an initial backlight brightness based on the power source (either AC or battery) and the ambient light level (either very bright, i.e. direct sunlight, or something dimmer than that). Note that the brightness percentages appearing in powerd's log are not computed linearly; see policy::InternalBacklightController::PercentToLevel() for details.
Devices that lack ambient light sensors just use the "normal ambient light" levels listed above. Note that these levels may be set differently for different devices.
In the past, powerd made continuous adjustments to the screen brightness based on the ambient light level. This was distracting to users and also generally ineffective: the majority of indoor environments occupy the bottom end of the range reported by our ambient light sensors. Due to the coarse readings within this range, the automatically-chosen brightness levels were frequently undesirable. We decided to switch to just two levels: one that would work well in most indoor environments, and a very-bright level for outdoor environments.
When the power source or ambient light level changes, powerd transitions to the new brightness level. When the user presses the brightness-up or brightness-down keys, powerd animates to the requested level and stops making ambient-light-triggered automated adjustments until the system is rebooted.
A single user-configured brightness is tracked for both AC and battery power; once the user has adjusted the brightness via the brightness-up and brightness-down keys, the brightness remains at that level until the next time the system boots. Note that this implies that until the user touches a brightness adjustment key that the brightness will vary automatically between battery and AC power scenarios. (Prior to M36, separate user-configured levels were maintained for AC and battery power -- see issue 360042.)
In the past, the previous user-configured level was restored at boot, but this was deliberately removed. A given device is frequently used in many different environments: dark rooms, well-lit rooms with lots of ambient light, etc. We decided that always booting with a reasonable default brightness was preferable to sometimes restoring a blindingly-high brightness when booting in a dark room or restoring an extremely-dim brightness when booting in a bright room.
When the user is inactive for an extended period of time, the screen is dimmed to 10% of its maximum level (computed linearly) and then turned off. The screen is turned back on in response to user activity (which is interpreted broadly: keyboard or touchpad activity, power source change, external display being connected or disconnected, etc.).
Users may reduce the backlight brightness to 0% using the brightness-down (F6) key; this may be desirable to conserve battery power while streaming music. The backlight is automatically increased to a low-but-visible level when user input is observed after the brightness has been manually set to 0%.