Further explanation of the origin.
reply
That's a good question. The answer is that I don't know. It's part of the Mahabharata. The Vedas were an oral tradition before they were written. Krishna as the avatar historically is 5,000 years ago. The Kurukshetriaya Battle is also 5,000 years ago.
reply
In the Introduction of the Bhagavad-Gita Swami Prabhupada explains regarding the history of this document:
Vedic knowledge is not imparted by such defective living entities. It was imparted unto the heart of Brahma, the first created living being, and Brahma in his turn disseminated this knowledge to his sons and disciples, as he originally received it from the Lord. The Lord is purnam, all-perfect, and there is no possibility of His becoming subjected to the laws of material nature. One should therefore be intelligent enough to know that the Lord is the only proprietor of everything in the universe and that He is the original creator, the creator of Brahma. In the Eleventh Chapter the Lord is addressed as prapitamaha because Brahma is addressed as pitamaha, the grandfather, and He is the creator of the grandfather. So no one should claim to be the proprietor of anything; one should accept only things which are set aside for him by the Lord as his quota for his maintenance.

THE DISCIPLIC SUCCESSION

Evam parampara-praptam imam rajarsayo viduh. (Bhagavad-gita, 4.2) This Bhagavad-gita As It Is is received through this disciplic succession:
  1. Krsna,
  2. Brahma,
  3. Narada;
  4. Vyasa,
  5. Madhva,
  6. Padmanabha,
  7. Nrhari,
  8. Madhava,
  9. Aksobhya,
  10. Jayatirtha,
  11. Jnanasindhu,
  12. Dayanidhi,
  13. Vidyanidhi,
  14. Rajendra,
  15. Jayadharma,
  16. Purusottama,
  17. Brahmanyatirtha,
  18. Vyasatirtha,
  19. Laksmipati,
  20. Madhavendra Puri,
  21. Isvara Puri, (Nityananda, Advaita),
  22. Lord Caitanya,
  23. Rupa (Svarupa, Sanatana),
  24. Raghunatha, Jiva,
  25. Krsnadasa,
  26. Narottama,
  27. Visvanatha,
  28. (Baladeva) Jagannatha,
  29. Bhaktivinode,
  30. Gaurakisora,
  31. Bhaktisiddhanta Sarasvati,
  32. His Divine Grace A.C. Bhaktivedanta Swami Prabhupada.

In Chapter 4 there is the succession explanation and as far as time goes Brahma
Thus, some 2,005,000 years ago, Manu spoke the Bhagavad-gita to his disciple and son Maharaja lksvaku, the King of this planet earth.
TEXT BELOW:

History of the Bhagavad-Gita

Chapter 4: Transcendental Knowledge
sri-bhagavan uvaca imam vivasvate yogam proktavan aham avyayam vivasvan manave praha manur iksvakave 'bravit
SYNONYMS
sri bhagavan uvaca—the Supreme Personality of Godhead said; imam—this; vivasvate—unto the sun-god; yogam—the science of one's relationship to the Supreme; proktavan—instructed; aham—I; avyayam—imperishable; vivasvan—Vivasvan (the sun-god's name); manave—unto the father of mankind (of the name Vaivasvata); praha—told; manuh—the father of mankind; iksvakave—unto King Iksvaku; abravit—said.
TRANSLATION
The Blessed Lord said: I instructed this imperishable science of yoga to the sun-god, Vivasvan, and Vivasvan instructed it to Manu, the father of mankind, and Manu in turn instructed it to Iksvaku.
PURPORT
Herein we find the history of the Bhagavad-gita traced from a remote time when it was delivered to the royal order, the kings of all planets. This science is especially meant for the protection of the inhabitants and therefore the royal order should understand it in order to be able to rule the citizens and protect them from the material bondage to lust. Human life is meant for cultivation of spiritual knowledge, in eternal relationship with the Supreme Personality of Godhead, and the executive heads of all states and all planets are obliged to impart this lesson to the citizens by education, culture and devotion. In other words, the executive heads of all states are intended to spread the science of Krsna consciousness so that the people may take advantage of this great science and pursue a successful path, utilizing the opportunity of the human form of life. In this millennium, the sun-god is known as Vivasvan, the king of the sun, which is the origin of all planets within the solar system. In the Brahma-samhita it is stated:
yac-caksur esa savita sakala-grahanam raja samasta-sura-murttir asesa-tejah yasyajnaya bhramati sambhrta-kalacakro govindam adi-purusam tam aham bhajami
"Let me worship," Lord Brahma said, "the Supreme Personality of Godhead, Govinda [Krsna], who is the original person and under whose order the sun, which is the king of all planets, is assuming immense power and heat. The sun represents the eye of the Lord and traverses its orbit in obedience to His order."
The sun is the king of the planets, and the sun-god (at present of the name Vivasvan) rules the sun planet, which is controlling all other planets by supplying heat and light. He is rotating under the order of Krsna, and Lord Krsna originally made Vivasvan His first disciple to understand the science of Bhagavad-gita. The Gita is not, therefore, a speculative treatise for the insignificant mundane scholar but is a standard book of knowledge coming down from time immemorial. In the Mahabharata (Santi-parva 348.51-52) we can trace out the history of the Gita as follows:
treta-yugadau ca tato vivasvan manave dadau manus ca loka-bhrty-artham sutayeksvakave dadau iksvakuna ca kathito vyapya lokan avasthitah
"In the beginning of the Treta-yuga [millennium] this science of the relationship with the Supreme was delivered by Vivasvan to Manu. Manu, being the father of mankind, gave it to his son Maharaja Iksvaku, the King of this earth planet and forefather of the Raghu dynasty in which Lord Ramacandra appeared. Therefore, Bhagavad-gita existed in the human society from the time of Maharaja Iksvaku."
At the present moment we have just passed through five thousand years of the Kali-yuga, which lasts 432,000 years. Before this there was Dvapara-yuga (800,000 years), and before that there was Treta-yuga (1,200,000 years). Thus, some 2,005,000 years ago, Manu spoke the Bhagavad-gita to his disciple and son Maharaja lksvaku, the King of this planet earth. The age of the current Manu is calculated to last some 305,300,000 years, of which 120,400,000 have passed. Accepting that before the birth of Manu, the Gita was spoken by the Lord to His disciple, the sun-god Vivasvan, a rough estimate is that the Gita was spoken at least 120,400,000 years ago; and in human society it has been extant for two million years. It was respoken by the Lord again to Arjuna about five thousand years ago. That is the rough estimate of the history of the Gita, according to the Gita itself and according to the version of the speaker, Lord Sri Krsna. It was spoken to the sun-god Vivasvan because he is also a ksatriya and is the father of all ksatriyas who are descendants of the sun-god, or the surya-vamsa ksatriyas. Because Bhagavad-gita is as good as the Vedas, being spoken by the Supreme Personality of Godhead, this knowledge is apauruseya, superhuman. Since the Vedic instructions are accepted as they are, without human interpretation, the Gita must therefore be accepted without mundane interpretation. The mundane wranglers may speculate on the Gita in their own ways, but that is not Bhagavad-gita as it is. Therefore, Bhagavad-gita has to be accepted as it is, from the disciplic succession, and it is described herein that the Lord spoke to the sun-god, the sun-god spoke to his son Manu, and Manu spoke to his son Iksvaku.
reply