Although the Buddhist scripture was originally written in ancient Pali, Sanskrit, and Prakrit, the Buddha didn’t speak any of these.
Shakyamuni Buddha (the historical Buddha), spoke a local dialect called Magadhi or Ardhamagadhi. There is no record of the Buddha’s words in his own language. This makes knowing exactly what the Buddha said very difficult.
However, as Ven. Thich Nhat Hanh explains, we can still find a way to ensure a teaching is correct:
By comparing the two extant sutra recensions, we can see which teachings must have preceded Buddhism’s dividing into schools. When the sutras of both transmissions are the same, we can conclude that what they say must have been there before the division. When the recensions are different, we can surmise that one or both might be incorrect. The Northern transmission preserved some discourses better, and the Southern transmission preserved others better. That is the advantage of having two transmissions to compare.
(Note: Southern Transmission refers to Theravada, and Northern Transmission refers to Mahayana)