There are several similar but conflicting stories of the origin of these arms. They all have to do with a warrior, whose shield was plain gold, dying after a great battle, and a person of rank (in some stories, one king; in others, another) dips his fingers into the blood of the dying knight and draws four red stripes down the shield, which his descendants have borne since.
But as always, it seems, the devil is in the details. In some stories, the dying knight is Geoffroy le Velu, king of Aragon; in others, Guifre el Pelós (Wilfred the Hairy, or Wilfred the Bearded), Count of Barcelona. In one version, he has been mortally wounded fighting the Normans; in another, the Moors (in some cases, specifically by Lobo ibn Mohammed, the Moorish governor of Lleida). The grateful monarch who dipped his fingers in the knight’s blood is Charles le Chauve (Charles the Bald); another version makes him Louis the Pious; and yet a third version seeks to avoid the chronological difficulties with both of these kings (Charles the Bald had died 20 years before the time of the event central to the story, and Louis the Pious died before Guifré was born), and has Guifré himself so mark his own shield. The years in which this incident is supposed to have occurred include 897, at the siege of Barcelona, and 888 from the hands of the Emperor Charlemagne (and both dates precede by nearly three centuries the rise of the use of heraldry). In either case, the story does not appear until the mid-15th Century.
And if all that isn’t confusing enough, another medieval variant of the legend features Ramon Berenguer IV, Count of Barcelona, painting the four pallets with his own blood on a plain yellow shield, that shield being the arms of Aragon before his marriage to Petronila of Aragon (who was only one year of age at the time of the marriage, but that’s another story).
In the end, what does all of this mean for us? It means we have to be careful about accepting the stories about the origin of a coat of arms, because many of these origin stories, while they sound really cool, often just don’t hold up to any kind of dispassionate historic scrutiny.