sandhi contraction
Analysis. yaṃ (accusative neuter of ya 'which') + yad (nominative neuter of ya 'which') + eva (just, only) — the first ya is attracted into sandhi form yaṃ before the second ya surfaces as yad; together they emphasize indifference or universality: 'whichever it may be, just that'.
Etymology. ya is the Indo-European relative pronoun, cognate with Latin qui/quod, Greek hoς (hos), English who/what; eva 'just, only' reinforces the sense of bare selection or emphasis.
Meanings from the Digital Pāḷi Dictionary; morphology and etymology by Claude.
Lite mode — plain HTML for e-readers and old browsers. Full version