This paper from Silvia Luraghi explores the origin of PIE grammatical gender system, as well as proposing how it appeared in the language, in a way that accounts for the following discrepancy:
- Hittite - two genders system: animate and inanimate
- Late PIE - typically three genders system: masculine, feminine, and neuter
The animate and inanimate genders would’ve been inherited by late PIE as the masculine and neuter genders respectively, while the feminine would be the result of a derivational suffix *-h₂ being attached to words, and eventually triggering agreement. Note that the typical IE feminine /a/ (you see it in Latin/Romance and Slavic languages, for example) is believed to be from *h₂, as it’s the a-colouring laryngeal.
I know that this paper might be a bit too deep for most folks here to parse, so if you feel intimidated, don’t be afraid to ask for help.
This paper is a good overview of the problem and does a good job of tackling the sociolinguistic factors that could help drive such a change, but the specifics of how this was instantiated through the morphology of PIE is still debated.
For a more in-depth look at the specifics of the morphological problem, here are Melchert 2014 and Kim 2009 (though see Fellner 2016’s rebuttal of Kim’s data and a bit more on the Tocharian reflexes). Note that these are more difficult than the Luraghi paper cited in the OP - feel free to ask if anyone has any questions.
Those are amazing papers - thank you for sharing!