The Gita is a dialogue between the warrior-prince Arjuna and the god Krishna who is serving as his charioteer at the Battle of Kurukshetra fought between Arjuna's family and allies the Pandavas and those of the prince Duryodhana and his family the Kauravas and their allies. This dialogue is recited by the Kauravan counselor Sanjaya to his blind king Dhritarashtra both far from the battleground as Krishna has given Sanjaya mystical sight so he will be able to see and report the battle to the king.
The Kauravas and Pandavas are related and there are mutual friends and family members fighting on both sides for supremacy of rule. Accordingly, when Arjuna sees all his former friends and comrades on the opposing side, he loses heart and refuses to take part in a battle which will result in their deaths as well as many others. The rest of the text is the dialogue between the prince and the god on what constitutes right action, proper understanding and, ultimately, the meaning of life and nature of the Divine.