The best resource for understanding the historical context of Gurbani would be the Amritsar Taksal's commentary on Guru Granth Sahib, Amir Bhandar. All volumes of the commentary are available: Faridkot Tika also provides some information regarding the historical context of certain compositions, you can display the Faridkot Tika on The Giania Bunga in the 18th century wrote a text, ਉਥਾਨਕਾਵਾਂ, which briefly mentions the historical context of various compositions in [[Adi Guru Granth Sahib/Adi]] Guru Granth Sahib, and this tradition of providing this information has flowed from generation to generation within traditional learning institutions (ਸੰਪ੍ਰਦਾਵਾਂ).