Found this interesting article about the origin of Pali language on Wikipedia
There is persistent confusion as to the relation of Pāḷi to the vernacular spoken in the ancient kingdom of
Magadha, which was located around modern-day
Bihār. Beginning in the Theravada commentaries, Pali was identified with '
Magahi', the language of the kingdom of
Magadha, and this was taken to also be the language that the Buddha used during his life.
[3] In the 19th century, the British
Orientalist Robert Caesar Childers argued that the true or geographical name of the Pali language was
Magadhi Prakrit, and that because
pāḷi means "line, row, series", the early Buddhists extended the meaning of the term to mean "a series of books", so
pāḷibhāsā means "language of the texts".
[6]
However, modern scholarship has regarded Pali as a mix of several
Prakrit languages from around the 3rd century BCE, combined and partially Sanskritized.
[7] There is no attested dialect of Middle Indo-Aryan with all the features of Pali.
[3]: 5 In the modern era, it has been possible to compare Pali with inscriptions known to be in Magadhi Prakrit, as well as other texts and grammars of that language.
[3] While none of the existing sources specifically document pre-Ashokan Magadhi, the available sources suggest that Pali is not equatable with that language.
[3]
Modern scholars generally regard Pali to have originated from a western dialect, rather than an eastern one.
[8] Pali has some commonalities with both the western
Ashokan Edicts at
Girnar in
Saurashtra, and the Central-Western Prakrit found in the eastern
Hathigumpha inscription.
[3]: 5 These similarities lead scholars to associate Pali with this region of western India.
[9] Nonetheless, Pali does retain some eastern features that have been referred to as
Māgadhisms.
[10]
Pāḷi, as a
Middle Indo-Aryan language, is different from
Classical Sanskrit more with regard to its dialectal base than the time of its origin. A number of its
morphological and lexical features show that it is not a direct continuation of
Ṛgvedic Sanskrit. Instead it descends from one or more dialects that were, despite many similarities, different from Ṛgvedic.
[11]
https://en.m.wikipedia.org/wiki/Pali