A mahram is a man whom a woman is permanently forbidden to marry, and that permanence is precisely what makes travel with him, seclusion with him, and relaxed covering in his presence permissible. They fall into three categories: by lineage — her father and grandfathers, her sons and grandsons, her brothers, her brothers' and sisters' sons, and her paternal and maternal uncles; by marriage — her father-in-law, her stepfather, her stepsons, and her sons-in-law (Quran 4:22–23); and by breastfeeding, since the Prophet ﷺ said of Ḥamzah's daughter, "She is not lawful for me; what is forbidden by blood ties is forbidden by nursing — she is the daughter of my foster brother" (Sahih al-Bukhari 2645), so foster relations are mahram exactly as blood relations are, subject to the conditions of valid nursing. Quran 4:23 enumerates the permanently unmarriageable relatives, and 24:31 names those before whom she is not required to observe the full covering. Cousins and a husband's brother are emphatically not mahrams — the Prophet ﷺ warned specifically about the husband's relatives, saying "the in-law is death" (Sahih al-Bukhari 5232), because these are the men most often treated as family while remaining non-mahram.
Q&A · Women in Islam
Who exactly counts as a woman's mahram?
Evidence — the daleel
On deen2u
Informational, not a personal fatwa. Consult a qualified scholar for rulings on your situation.