> Sanskrit appeared later and is often used in Mahayana traditions.
While Sanskrit was used in later Buddhist traditions, the term "dhyana" in Sanskrit predates the Buddha, as it was used in the Vedas, and a lot of Pali does seem to derive from Sanskrit (or at least, other local languages that were influenced by Sanskrit).
Now, "modern" Sanskrit and "vedic" Sanskrit can be considered two things (like English and Old English), but many of the terms used are the same, hence its influence on Pali that compare to modern Sanskrit terms.
While Sanskrit was used in later Buddhist traditions, the term "dhyana" in Sanskrit predates the Buddha, as it was used in the Vedas, and a lot of Pali does seem to derive from Sanskrit (or at least, other local languages that were influenced by Sanskrit).
Now, "modern" Sanskrit and "vedic" Sanskrit can be considered two things (like English and Old English), but many of the terms used are the same, hence its influence on Pali that compare to modern Sanskrit terms.