on the history of the Earldom of Huntingdon:
After Earl Simon's [Matilda's 1st husband] death, his Widow married David I of Scotland, who consequently became Earl of Huntingdon too, keeping the Earldom even after he succeeded his brother as King of Scots. He sided with the Empress Maud against Stephen I but came to terms with the latter and made the Earldom over to his son Henry. Henry swore fealty to Stephen but subsequently fought against him under the Scottish banner, which may account for Simon de St Liz's son, another Simon, being recognized as Earl of Huntingdon before Henry's death in 1152. Thereafter the Earldom was more or less bounced back and forth between the de St Liz family and the Kings of Scotland, first being held 1157-65 by Malcolm the Maiden and (1165-74) by his brother William The Lion, King of Scots, then by a Simon de St Liz (grandson of the first Simon and son of the second) from 1174 to 1184.
When the third Simon de St Liz died in 1184 he left no surviving issue and David, younger brother of the Kings of Scots just mentioned, assumed the Earldom from 1185 (on the handing over of it to him by William the Lion) till it was taken away from him in 1215 or 1216 by King John. He got it back again in 1218, however. David's son John was the last member of the Scottish royal family to hold the title, doing so from his father's death in 1219 till his own in 1237. [Burke's Peerage]
-------------------------------------------------------------------------------------
EARLDOM OF HUNTINGDON (X)
EARLDOM OF CHESTER (VIII, 5)
JOHN (LE Scot), EARL OF HUNTINGDON AND CAMBRIDGE (nephew of William the Lion, King of Scotland), being 3rd and youngest, but only surviving son and heir of David, EARL OF HUNTINGDON &C., by Maud, 1st sister and coheir of Ranulph (DE BLUNDEVILLE), EARL OF CHESTER, was born about 1207; succeeded his father as Earl of Huntingdon, &c., 12 June 1219, having livery of his lands 25 April 1227; was knighted by Alexander III 30 May 1227; and, after the death of the Earl of Chester, his uncle, though apparently in the lifetime of his mother (who d. Epiphany 1233), having inherited the whole County Palatine of Chester, was created, at Northampton, 21 November 1232, EARL OF CHESTER. At the Coronation of Queen Eleanor, 20 January 1235/6, he bore the " Curtatia," one of the three swords of State, as Earl of Chester, and claimed to bear the second sword as Earl of Hutitingdon. He took the Cross about 8 June 1236. He married, 1222, Helen, daughter of LLEWELLYN AP IORWERTH, PRINCE OF NORTH WALES, and by her is suspected to have been poisoned. He died s.p., at Darnall, co. Chester, very shortly before 6 June 1237, and was buried at St. Werburg's, Chester, leaving the two daughters of his eldest sister and his three surviving sisters, as his coheirs, but in 1246 the Earldom of Chester was annexed to the Crown "lest so fair (preclara) a dominion should be divided (inter colas feminarum) among women." His widow married, before 5 December 1237, Robert DE QUINCY (youngest son of Saher, Earl of Winchester), who died s.p.m., August 1257. She died 1253, before 24 October. [Complete Peerage III:169-70, (transcribed by Dave Utzinger)]
Note: John was the last non-royal Earl of Chester, other than a brief period 1264-1265 when Simon de Montfort became Earl by coercing Henry III (a prisoner after the battle of Lewes) into giving him the title, which Prince Edward "Longshanks" had at the time. He (eventually Edward I) regained it in 1265. Usually the royal heir-apparent received the earldom about the same time that he received the title "Prince of Wales."