Justice Shallow first appears in Henry IV, Part 2 as an old friend of Falstaff's. In this play they have a very warm relationship. Falstaff owes him a thousand pounds and when Henry IV dies at the end of the play, Falstaff asks Shallow to follow him to the castle. Falstaff believes that his drinking buddy Prince Hal, now King Henry V, will reward him for his long devotion and friendship. Instead the new King Henry ignores Falstaff, leaving the folly of youth behind, and devastating the fat knight.
Shallow witnesses this and, rather than press his friend for the money, he tries to forgive him half of the debt and asks Falstaff to come to his home in the country [Windsor]. Falstaff agrees but says that he will pay him what he owes.