Madrileños please correct any inaccuracies... Here is Lonely Planet´s explanation )somewhat paraphrased:
Quote:

The city symbol is a she-bear nuzzling a madroño, bordered by a frame bearing seven 5-point stars and topped by a crown. When Alfonso VI took Madrid in 1085 the town was symbolically seen as the first in the long line of conquests that would take Christians south. Thus madrid became an example of things to come, or a north point. Another popular explanation for the stars is that Madrid, like Rome, was built on seven hills. As it happens, a group of seven stars that lies close to the north star in the northern hemisphere is Ursa Minor, or small she-bear.

The fact that in medieval times bears roamed the El Pardo area just north of Madrid adds a more prosaic (and more likely) spin to the explanation. The madroño was also once common around Madrid. The bears have long since gone but the madroño can be seen in Puerta del Sol.

The crown has to do with Carlos I allowing Madrid to use the symbol of the crown after curing a fever using madroño leaves.

The five points of the stars represent the five provinces that surround the Comunidad de Madrid: Segovia, Ávila, Toledo, Cuenca, and Guadalajara.
::Phew:: that was a lot of typing!

I really don´t get all of my information about Spain from Lonely Planet, but it does happen to be a handy reference that at the moment is right next to my computer smile