The commonly held understanding is that it means the first-born male heir—or eldest male descendant living—inherits. This was called agnatic or patrilineal primogeniture. One variation on this—agnatic seniority—was used by the later Ottoman Empire, in which the eldest male sibling of the deceased ruler had the right to take over. The Ottomans and the Kievan Rus followed this, where succession passed through the siblings first and then back to the eldest son of the deceased.
What about females in the line of succession? Absolute primogeniture (also called equal or lineal) recognizes the eldest child regardless of sex, and did not exist until 1980, when Sweden amended its Act of Succession. Several monarchies (Netherlands, Norway, Belgium, Denmark, Luxembourg) have since changed their laws to allow inheritance from the eldest child, no matter their sex.
Queens Mary and Elizabeth from England's history existed because there were no male heirs; had there been any, those women would not have been chosen. This is now referred to as "male-preference" primogeniture. England changed to absolute primogeniture in 2013, a change that was simultaneously adopted in all related Commonwealth countries.
Matrilineal primogeniture exists, though it is rare. The Balobedu nation of South Africa are ruled by the Rain Queen, and succession passes to eldest daughter; males were completely excluded until 2021, when the late queen's son became the Rain King.
Male-centered primogeniture most likely arose from the need early on for a leader to be a military leader and to fight other tribes while females raised children. Also, a law that created a clear line of succession would help to prevent sibling arguments that could end in civil war. Younger sons went into military service or the Church. Also, the Bible offered the example of Isaac's son Esau being owed the birthright as elder over Jacob (and foolishly selling it to his younger sibling). In the Middle Ages, possession of land was a crucial part of the feudal system. Keeping large tracts of land intact was beneficial to the person at the top, and primogeniture (and entail, keeping the land together) was efficient.
Salic law, laid down in 500 and the basis of Frankish law, forbade women from inheriting, but also allowed partible inheritance, which meant estates could be divided to keep everyone happy. By Salic law, Edward III, as the eldest son of Isabella, the sister of King Charles IV of France, should have inherited the throne of France upon Charles' death in 1328. Nobles and prelates of France decided that inheritance through the mother was no longer appropriate, and denied Edward his right to the throne, providing the catalyst for the Hundred Years War. Semi-Salic law allowed women to inherit in the absence of any males. Quasi-Salic law refers to allowing inheritance—in the absence of appropriate males—not by a woman, but through her to her son.
Curiously, there was also something called ultimogeniture, or junior right, which is a tradition that allows inheritance by the youngest. Why would that be? I'll explain next time.