|Endogamy and exogamy|
Endogamy is when one marries someone within one's own group. Exogamy is when one marries someone outside one's own group.
"One's own group" may be more or less comprehensive: thus, "ethnic endogamy" would mean that e.g. Norwegians only married other Norwegians; "community endogamy" would mean that one only married other members of one's community.
The organizational advantage of endogamy is that few outsiders are brought into the group, so inheritance and property are not dissipated among too many persons. The organizational advantage of exogamy is that outsiders are constantly brought in, which might be desirable, e.g. if the group has shortages in their work force. Exogamy also means that representatives of other, potentially enemy groups will be present in your own group, exerting pressure to avoid conflicts. The exchange of spouses across groups, is therefore a classical mechanism of alliance formation. (See kinship, descent, affinal.)