Thomas was probably born around 1278 or 1279 - so was about five or six years older than Edward II - as the eldest son of Edmund of Lancaster (1245-1296) and Blanche of Artois (c. 1245/48-1302). Edmund of Lancaster was the younger son of Henry III and Eleanor of Provence and thus the brother of Edward I; Blanche was the niece of Louis IX of France and the widow of Enrique I 'the Fat', king of Navarre and count of Champagne and Brie. By Enrique, Blanche had one surviving child, Jeanne or Juana, queen of Navarre in her own right and queen of France by marriage to Philip IV. Blanche was thus the grandmother of Louis X, Philip V, Charles IV and Edward II's queen Isabella, and was also Edward's aunt by marriage.
When they were growing up, Thomas of Lancaster and his younger brother Henry (born c. 1281, married Maud Chaworth) were nephews of the king of England and brothers-in-law of the king of France, and in adulthood were first cousins of the king of England and (half-) uncles of three kings of France and the queen of England, so were extremely high-born and well-connected. (The fact that Thomas was Isabella of France's uncle has been missed by a surprisingly large number of writers, including a PhD thesis about Isabella and a couple of novelists who have written him as being in love with her.) Thomas and Henry had another brother, John, who spent most of his life in France and died childless in 1317 - Henry inherited his lands, which included Beaufort and ultimately passed to Henry's grandson-in-law John of Gaunt - and a sister, Mary, who died in infancy. Perhaps surprisingly, Thomas of Lancaster's childhood is very obscure; his date of birth can't even be narrowed down to a year, let alone a specific date. His father Earl Edmund died in June 1296 when Thomas was probably about seventeen or eighteen, and his uncle Edward I granted him his lands and earldoms in 1298, although he was still underage. Thomas's paternal grandmother Eleanor of Provence, widow of Henry III and of course also Edward II's grandmother, made him her heir to her claim to her father's county of Provence in May 1286, to revert to his brothers Henry and John if Thomas died childless.  Edward II, as heir of their grandmother's sister Sanchia, queen of Germany and countess of Cornwall, tried unsuccesfully to claim a share of Provence from his kinsman Robert, king of Sicily and count of Provence, in 1323; Thomas had also put forward a claim, and was rebuked by Pope John XXII in early 1322 for failing to speak courteously enough of Robert of Sicily. 
Edward I arranged a marriage for his nephew in August 1290, when Thomas was about eleven or twelve: the king and Philip IV of France confirmed an agreement that Thomas would marry Beatrice, daughter of Hugh, viscount of Avallon (1260-1288), eldest son of Hugh IV, duke of Burgundy by his second wife Beatrice, sister of King Enrique I of Navarre.  Little Beatrice was born in 1281, and the wedding plans fell through when she died suddenly in 1291. The following year, Thomas was betrothed to Alice de Lacy, who inherited the earldom of Lincoln from her father Henry and the earldom of Salisbury from her mother Margaret Longespee, and they married in October 1294 when Alice was twelve going on thirteen and Thomas fifteen or sixteen. Marriage to Beatrice would have provided Thomas with an annual income of £4500; marriage to Alice de Lacy gave him about 10,000 marks (£6666) per annum, and he got two more English earldoms (on top of the three, Lancaster, Leicester and Derby, he inherited from his father) into the bargain. Unfortunately, it proved to be a disastrous, and childless, match, and Alice left Thomas in 1317. Thomas, however, was certainly not bereft of female company and fathered at least two illegitimate sons, Thomas and John: John is mentioned in papal letters and various other sources as a Master of Arts, a 'scholar of theology' and a canon of Lincoln and Uttoxeter, and Thomas was a knight who requested permission in 1354 to become a Friar Minor. It's interesting that Earl Thomas must have fathered John on one of his second cousins, as a papal letter of 1349 describes John as "the son of a a married man and a spinster related in the third degree of kindred."  I would speculate that Thomas's unknown mistress must have been illegitimate or descended from an illegitimate line, as Thomas's legitimate second cousins were too high-born to be his mistresses, at least without anyone noticing. John was still alive in 1369, forty-seven years after his father's execution.
Edward of Caernarfon and Thomas of Lancaster were apparently on very good terms before Edward's accession. In 1305, Thomas was forced to apologise to Edward for being unable to come and attend him, as he was ill. Edward wrote back to say that he hoped to visit Thomas soon, "to see and to comfort you."  This closeness continued after Edward became king of England in July 1307, a fact missed by many novelists, who assume that the two men were even then at loggerheads and that Thomas was always his cousin's enemy. In fact, Thomas was in almost constant attendance on Edward for the first sixteen months or so of his reign, and he was one of only a handful of men, who included the king's and Thomas's first cousin the earl of Richmond, Hugh Despenser the Elder and his retainer Sir John Haudlo, who remained loyal to Edward II in the spring of 1308 when the majority of the barons were pressing for Piers Gaveston's exile.
In November 1308, however, Thomas appears to have abruptly left court; he witnessed no more charters after this date until March 1310, and the constant flow of grants and favours to him from Edward also ceased.  There is no evidence of an argument between the king and his powerful cousin in any chronicle, but for some reason Thomas, who had previously been on amicable terms with Piers Gaveston, became implacably opposed to Piers' return from Ireland, and when Thomas and the earls of Pembroke, Warwick and Hereford visited Edward at Kennington in May 1309, they asked for safe-conducts, which were guaranteed by the earls of Lincoln, Richmond, Gloucester and Arundel - evidence of how little Thomas now trusted the king.  The cause of the rift between king and earl remains unknown - the Vita Edwardi Secundi says that "one of his [Thomas's] household had been thrown out of office at Piers' instance," and Andy King plausibly speculates that this is a reference to the Yorkshire knight Gerald Salveyn  - but the hostility between the two richest and most powerful men in the country was to dominate English political life until 1322. As Dr King points out, "both men seem to have been particularly stubborn" and a minor disagreement might well have been blown up out of all proportion with neither man prepared to back down and offer an olive branch. Edward II and his cousin seem to have been very similar in a number of ways, neither of them willing to set aside personal likes and dislikes in the interests of policy.
At any rate, Thomas slowly moved into the position of the king's enemy, which he would hold until his death. In February 1311, his father-in-law Henry de Lacy, earl of Lincoln, died, and Thomas inherited his lands by right of his wife Alice. He had to perform homage to Edward II for the lands, but Edward was then on campaign in Scotland. Thomas refused to cross the Tweed to meet the king; Edward refused to return to England. According to the Lanercost chronicle, Thomas threatened to forcibly enter his lands with a hundred knights, at which Edward gave in and met Thomas at Haggerston, on the English side of the river Tweed. Whatever they felt for each other by then, the men at least managed to conceal any hostility and "saluted each other amicably and exchanged frequent kisses."  In the autumn of 1311, Thomas was one of the men who forced Edward II to accept the Ordinances, forty-one 'reforms' which severely limited the king's powers. The twentieth Ordinance mandated the third, and perpetual, exile of Piers Gaveston; Edward promised to abide by all the others if only the Ordainers would revoke that one, saying "Whatever has been ordained or decided upon, however much they may redound to my private disadvantage, shall be established at your request and remain in force for ever. But you shall stop persecuting my brother Piers, and allow him to have the earldom of Cornwall."  They refused.
Furious and bereft as Edward II certainly was, he kept his feelings under wraps in public and wrote courteously to Thomas's closest adherent Sir Robert Holland on 20 November 1311, just weeks after Piers Gaveston's departure: "We are very joyous and pleased about the good news we have heard concerning the improvement in our dear cousin and faithful subject Thomas, earl of Lancaster, and that he will soon be able to ride in comfort. And we send you word and dearly pray that, as soon as he is comfortable and able to ride without hurt to his body, you should ask him to be so good as to hasten to us at our parliament."  Thomas does seem to have been prone to illness, such as the occasion in 1305 when he was unable to travel to Edward, though what this was remains a mystery, and to judge by Edward's letter it sounds as though it may have been some kind of physical disability.In June 1314, Thomas refused to accompany his cousin to Scotland for the Bannockburn campaign, and sent only four knights and four men-at-armsto fulfil his feudal obligations. Edward's defeat to Robert Bruce put him at Thomas's mercy, and for the next few years the men were joint rulers of England - or, Edward was king in name and Thomas in reality. At a time when England and Wales were suffering from famine, Robert Bruce's brother Edward was invading Ireland and Bruce himself the north of England, and Edward II's subjects were crying out for strong leadership, he and Thomas did their best to thwart each other and were incapable of working together: "Whatever pleases the lord king, the earl’s servants try to upset; and whatever pleases the earl, the king’s servants call treachery…and their lords, by whom the land ought to be defended, are not allowed to rest in harmony." 
The Lincoln parliament of early 1316 - at which Thomas of Lancaster finally deigned to show up more than two weeks late - requested of the king’s "dear cousin" that "he might be pleased to be chief of his council, in all the great or weighty matters concerning him [Edward] and his realm," and Thomas, "for the great love which he bears towards his said lord the king," graciously agreed.  In fact, Thomas thereafter took little part in government, preferring to stay at his favourite residence of Pontefract, where Edward and his council were forced to communicate and negotiate with him as though he were an independent potentate, or another king.  Why Thomas behaved like this is a mystery; perhaps his illness or physical disability prevented him taking a more active role. Edward and Thomas met in York in the summer of 1316 and had a furious row, apparently over Edward's ongoing reluctance to accept the Ordinances, to which Thomas - who saw himself as a second Simon de Montfort - was devoted.As bad as Edward II and Thomas of Lancaster's relationship had become, it was set to deteriorate even further as the king's new court favourites did their best to hinder a reconciliation - second part of the post coming soon!
Sources1) Calendar of Patent Rolls 1281-1292, p. 243.
2) Calendar of Papal Letters 1305-1341, p. 447.
3) Patent Rolls 1281-1292, p. 382.
4) Papal Letters 1342-1362, pp. 346, 357, 543, 545; Douglas Richardson, Plantagenet Ancestry.
5) Hilda Johnstone, ed., Letters of Edward, Prince of Wales 1304-5, p. 122.
6) J.R. Maddicott, Thomas of Lancaster 1307-1322: A Study in the Reign of Edward II, pp. 92-93.
7) Foedera 1307-1327, p. 75.
8) Vita Edwardi Secundi, ed. Noel Denholm-Young, p. 8; Andy King, ‘Thomas of Lancaster’s First Quarrel with Edward II’, in Fourteenth-Century England III, ed. Mark Ormrod.
9) The Chronicle of Lanercost 1272-1346, ed. Herbert Maxwell, p. 192.
10) Vita, pp. 17-20.
11) G.O. Sayles, The Functions of the Medieval Parliament, p. 302.
12) Vita, pp. 75-76.
13) Parliament Rolls of Medieval England, ed. Chris Given-Wilson et al.
14) May McKisack, The Fourteenth Century 1307-1399, p. 47.