As far as I've noticed, the first solid bar is the unit strength, which drops as the unit gets damaged. The second bar is the effective strength of the unit while defending in it's current square. If your unit is, say, in a square with +50% defense and your unit has an additional +50% def bonus for being in that type of square, you'll essentially see your health bar doubled.
Sadly, as far as I can find, this is not noted anywhere in the manual or the civilopedia or anything anywhere, but it seems to be true just based on moving my guys around the map and watching how the second half of the bar changes depending on terrain effects.