Gini coefficient is one of many related indices measuring the level of concentration or dispersion (or enthropy), based on the concept os summation of the squared shares, and thus varrying from zero to one. In essence it expresses the level to which distinct groups of individuals (or firms) share a given universe (e.g. the total income, total consumption/production, but also religion or language groups).
The general logic behind this measure is that the closer its value approaches one, the greater the level of concentration (i.e the greater the share of the universe concentrated in one group). If expressed as a fractionalization index by subtracting the value of concentration index from one, the closer it approaches one, the greater the dispersion levels (i.e. the smaller the share of the universe concentrated in any one particular group). Interpreted as a probability function, it expresses the probability that two randomly selected indivdiduals belong to the same or different groups.
The formula for Gini index is G= 1+ 1/N - (2/N)SumiPi where N stands for the number of categories which share the universe and Pi is the fractional share of the i-th category.
The limitation of the Gini index (as opposed to alternative concentration/dispersion measures) is that its upper value depends on the number of componets, specifically its upper limit is 1- 1/N. In substantive terms, the fewer the groups, the lower the possible value of Gini. Hence, if you want to "flatten" the image of income inequality, you would want to use as few income groups as possible.
For more info on this type of measure of concentration and sipersion see: Rein Taagpera and James Lee Ray, A Generalized Index of Concentration, _Sociological Methods and Research_ February 1977, 5(3):367-391.