Marguerite Henry took great license in telling the story of the Godolphin Arabian, but it's likely there were two reasons she did so; first, because she based the majority of her novel on heavily romanticised reports like that which appeared in Western Horseman in 1949; second, to illustrate to young children what could happen to perfectly good horses that were considered worthless because of prejudice or unwillingness to see what was there.
The real Sham was born in Tunis and given by the Bey of Tunis to King Louis XV with a group of other horses. But there's no evidence that he was reduced to pulling a cart in the Paris streets before rescue by Edward Coke. Coke probably got him from the Duke of Lorraine, who'd gotten him from the King.
A contemporary described Sham as "beautiful but half-starved", so the rough sea voyage with the greedy staff is likely true, even if the cart-horse story is not. He also said that Sham (he spelled it Shami, and other accounts have "Scham") was temperamental and generally disliked by the stable hands. A vet who cared for Sham in his last years said he was built to sire champions: "his shoulders were deeper, and lay farther into his back, than those of any horse ever yet seen. Behind the shoulders, there was but a very small space ere the muscles of his loins rose exceedingly high, broad, and expanded, which were inserted into his hindquarters with greater strength and power than in any horse I believe ever yet seen of his dimensions, viz fifteen hands high."
Agba was real; there are portraits of the little horse with a handsome dark-skinned young man in flowing Arab dress and turban. Whether or not he was mute is debatable. Again, many of the later accounts have been greatly romanticised. But Grimalkin the stable cat was real too, according to early records which report his presence in the famous portrait.
There is no record of the apocalyptic battle with Hobgoblin. We can look at that, and Sham's subsequent exile to Wicken Fen, as symbolic of the prejudice felt by the complacent English toward this relatively small, strange-looking newcomer. The truth is that Sham did mate with Lady Roxane and sired Lath. He sired 116 others in his long lifetime.
With all the interest in Seabiscuit of late, one would like to point out that as a direct descendant of Man O'War, he was also a direct descendant of the Godolphin Arabian. Just another horse who seemed worthless, but was not, and came from behind to prove the superiority of Arabian blood.
Look up "Davenport Arabians" to learn more about this proud line.