Let us see the origins of Bhagwad Geeta as described by Lord Krishna to Arjun.
This is explained in the verse given below:
śrī-bhagavān uvāca
imaṁ vivasvate yogaṁ
proktavān aham avyayam
vivasvān manave prāha
manur ikṣvākave ‘bravīt
In the above given verse, Shri Krishna tells about the origin of Bhagwad Geeta to Arjun.
He tells that in the ancient time, he had imparted the knowledge of Bhagwad Geeta to the Sun-god (Vivasvan). Vivasvan then told it to his disciple and son Manu. Manu in turn told it to his son and the first king of the Suryavanshi clan, King Ikshvaku (Lord Ram was the Scion of Ikshvaku). This is how Bhagwad Geeta can be traced back in time.
At present we have covered approximately 5000 years of the Kali-yuga which is about 432,000 years long. Prior to Kali-yuga there was Dwapar-yuga which lasted for about 800,000 years. Prior to the Dwapar-yuga there was Treta-yuga which lasted for about 1,200,000 years.
Roughly we can say that Bhagwad Geeta was first spoken about 120,000,000 years before.
The next verse is as follows:
evaṁ paramparā-prāptam
imaṁ rājarṣayo viduḥ
sa kāleneha mahatā
yogo naṣṭaḥ parantapa
The above verse tells us that this knowledge of supreme science was passed on from one generation to another but over a course of time it’s succession was broken and therefore this supreme science was lost.
The next verse goes on as follows:
sa evāyaṁ mayā te ‘dya
yogaḥ proktaḥ purātanaḥ
bhakto ‘si me sakhā ceti
rahasyaṁ hy etad uttamam
In this verse Shri Krishna tells that “this supreme science is retold by me to you (Arjun) and since you are my devotee therefore you can understand it.”
In the next verse Arjun asks Shri Krishna the following:
arjuna uvāca
aparaṁ bhavato janma
paraṁ janma vivasvataḥ
katham etad vijānīyāṁ
tvam ādau proktavān iti
Arjun asks that “the Sun-god(Vivasna) is very senior to you in terms of age. So how can I believe that you told him this science in the ancient time?”
The great Lord answered him in the following verse:
śrī-bhagavān uvāca
bahūni me vyatītāni
janmāni tava cārjuna
tāny ahaṁ veda sarvāṇi
na tvaṁ vettha parantapa
In this verse Shri Krishna explains that he himself and Arjun have taken many births in the past. He being the supreme personality remembers everything but Arjun being a mere mortal cannot remember anything about his past births.
He further explains this in the verse given below:
ajo ‘pi sann avyayātmā
bhūtānām īśvaro ‘pi san
prakṛtiṁ svām adhiṣṭhāya
sambhavāmy ātma-māyayā
In this verse he explains that he is unborn and his true body never deteriorates. He never attains old age. He further tells that he appears in his true transcendental form in every millennium.
There is one more verse which explains when does the great lord takes birth.
yadā yadā hi dharmasya
glānir bhavati bhārata
abhyutthānam adharmasya
tadātmānaṁ sṛjāmy aham
This verse is probably the most famous birth in the whole of Bhagwad Geeta. In this verse Shri Krishna explains that “whenever there is a fall of religious practices in the world. Whenever ignorance and corruption take over the world, whenever the evil gets over the good, I myself descend to end the turmoil and to place the religious principles again for the good of all.”