indefinite pronoun with enclitic particle
Analysis. ye (relative pronoun 'whoever', from ya) + api (enclitic 'even, also'). The combination expresses concession or generalizing indefiniteness: 'whoever it may be', 'whatever it might be'.
Etymology. ya is the old Indo-European relative pronoun stem (cognate with Latin qui, Greek hos, English who); api is a fossilized enclitic meaning 'even' or 'also', possibly related to Sanskrit api and Proto-Indo-European *h₂ep- 'to take hold of', but its original force in compound pronouns is to generalize or broaden the sense.
Meanings from the Digital Pāḷi Dictionary; morphology and etymology by Claude.
Lite mode — plain HTML for e-readers and old browsers. Full version