Why do we have "pryd gaeth hi ei geni" but "pryd gaeth e ei eni"? The softening only happens in the masculine sentence?
There's a soft mutation after ei (his) and an aspirate after ei her. So:
talu (pay) Gaeth e ei dalu (He was paid) Gaeth hi ei thalu (She was paid)
geni (bear, give birth) Gaeth e ei eni (He was born) Gaeth hi ei geni (She was born)
saethu (shoot) Gaeth e ei saethu (He was shot) Gaeth hi ei saethu (She was shot)
This used to be two separate words with different endings, one of which triggered soft mutation (Wiktionary says the masculine was esyo, which ends in a vowel - I think soft mutation often arose from consonants being between two vowels) and the other of which triggered aspirate mutation (esyās according to Wiktionary; I'm guessing this may have turned into something like esyāh which then aspirated, since s/h happens in several languages such as Greek and Spanish).
Later, the two words fell together in shape into ei, but kept their different mutation effects.
I imagine that something similar happened with yn which can have no mutation (before a verb), soft mutation (before a predicate noun or adjective; or to turn adjectives into adverbs), or nasal mutation (as the preposition "in").