The light in my car at least (09 328) comes on with a range indication of something like 35 or 30mi, and it's definitely range-driven, not remaining capacity driven. For example, if I'm driving aggressively, the light may come on, but then turn off if I start driving more economically. I think the 2.1gal is an estimation based on typical range at that fuel level.
That said, when my range indicates zero miles, there's still something like a half gallon in the tank. That's based on a specified 16.1gal tank (in my car, anyway) and a fill up at absolutely zero miles range indicated a couple days ago - the car took 15.6 gallons. Granted, the pump was having trouble with early cutoff, but I moved to a different pump to finish the fill, and the car read full after, so I can only assume everything's accurate.