All the information I could find about their alliance was the treaty of Windsor that followed up on it in 1386.And this text on Wikepedia: Castile was a traditional ally of France, so, looking for assistance in England was the natural option for John of Aviz. In May, with Lisbon under siege, an embassy was sent to Richard II of England to make a case for Portuguese independence. Richard was seventeen years old in 1384, and power lay with his uncle John of Gaunt, 1st Duke of Lancaster and regent of England. Despite initial reluctance to concede men, John of Gaunt finally agreed to levy troops to reinforce the Portuguese army.
But why did he finally agree to levy troops to reinforce the portuguese army?
There were both wider geo-strategical goals for England in supporting Portugal, as well as very important personal ones for John of Gaunt specifically.
To start painting the bigger picture, we should remember that England had significant holdings in France, and the English rule over these lands together with their claims to the entirety of France was the source of conflict known to us as the Hundred years war. One of the key English holdings was Aquitaine in southern France, bordering today's Spain. Further south, in 1360s there was a major civil war in Castile, between ruling king Peter of Castile, and his half-brother Henry Trastámara. I am not well versed with the details of this conflict, but basically the proximity of Castile to the Aquitaine, and the military balance it could change, dragged both the English (from Aquitaine) and French to be involved. The conflict ended with the French backed challenger Henry Trastámara deposing and killing English backed Peter. The conflict didn't stop there as Peter's daughter and heir Constanze was married to exactly John of Gaunt, the younger son of king Edward III, giving John of Gaunt the claim to Castilian throne through his wife. A claim he had lots of hopes to fulfill.
By this time - which is the 1370s -the stage was set. English and Castilians (with the French) were already at odds, John of Gaunt scheming to get a kingdom of his own while Henry Trastámara, naturally resenting this, moved closer to France and aided in several French actions against the English. The English in turn started moving in closer to Portugal - which was often at odds with Castile - as John of Gaunt needed an ally on the Iberian peninsula if he wanted to force his claim, or if English in general just wanted to keep pressure on Castilian flank. Several treaties were made with the Portuguese rulers, most famously one in 1373, conspiring to send English troops and invade Castile, but each time Portuguese would conclude peace with Castile before anything could come of it.
Then the 1383-1385 Portuguese conflict erupted. Castilian king, married to the daughter of the now deceased king Ferdinand of Portugal, was in line to take the throne. However there was a sort of "popular uprising" in Portuguese population against this merger, lead by João, master of military order of Aviz and half-brother of the deceased Portuguese king. João, who was badly outnumbered as many of Portuguese nobility sided with the Castilians, sent envoys to England asking for some form of assistance, in exchange offering to assist John of Gaunts in invasion of Castile. With this in mind it's sort of explained why they decided to help. John of Gaunt got a chance at the throne of Castile, while for English as a whole independent Portugual was better then Castilian Portugal.
Especially if we look at the actual nature of assistance provided. While English soldiers went and aided the Portuguese, those weren't royal or official troops but independent voluntary recruits. What the Portuguese asked for, and what was granted to them, was a license to hire mercenary troops, as well as be granted loans by London merchants to pay the advances for their wages and transport. While English royal authorization was necessary, and that meant some diplomatic fallout, it also meant that the English Crown had nothing really at stake in this operation, and much to gain.
Following the success of João and his proclamation as king João I of Portugal, the alliance was brought tighter. João honored his promise, went on to sign the Treaty of Windsor in 1386, and married John of Gaunt's daughter Philippa of Lancaster. Then he ultimately really assisted John of Gaunt when he invaded Castile later in 1386 after the laters landing in Galicia. Nothing came of this invasion, and John of Gaunt retreated and dropped his claims for some payment. Portugal were left in war with Castile until 1411, but kept good relations with England through the Queen, the above mentioned Philippa.
To sum up, John of Gaunt had a claim to become king of Castile, which he hoped assisting Portugal would help bring about. English as a state supported this action as part of their interests in the wider region which hoped to secure their holdings in southern France.