Pharyngealization is encountered in Semitic; some Interior Salishan languages; some Caucasian like Ubykh, Tsakhur and Udi; !Xóõ; Chilcotin; Berber languages; Even.
In some cases, it is a feature of vowels (Udi, !Xóõ). Sometimes it is involves consonants, but in a way that points to effect-on-vowel as an important feature of pharyngealization.
There is a connection between some Central Semitic pharyngealized (emphatic, uvularized) consonants and ejectives in South Semitic (Ethiopic and South Arabian, where the outcome is mixed and variable in South Arabian languages). There are various positions as to whether ejectives became pharyngealized or the converse: my limited grasp of the facts favors the "originally pharyngealized" hypothesis given the existence of pharyngealized ḍ in Arabic corresponding to ʕ in some forms of Aramaic, plus the fact that there's no such thing as "ejective d". I do think that it would be great to get a detailed Semitic-specific answer.
In Arabic and Berber it is typically analyzed as a feature of certain consonants, though it also phonetically affects adjacent vowels (in Arabic, the influence on vowels is large enough that it can be the only cue indicating a pharyngealized consonant). The consonants which are phonemically pharyngealized are mainly coronal, but there are pharyngealized dorsals reported for some dialects of Arabic in Yemen, and low-frequency emphatic labials are reported in Syrian Arabic. In Berber, the proto-language apparently had just "ḍ, ẓ" but other coronals have been picked up under Arabic influence; some analyses treat pharyngealization as a high-level prosody that starts at one point and continues to the end (analogous to the situation described by Hoberman in his Language article on Aramaic). Proto-Afro Asiatic reconstruction have been essayed by Dolgopolsky, but reconstruction of earlier phonetic values is fraught with difficulties.
In the case of Interior Salishan, there were primary pharyngeal consonants in the proto-language, which seem to have given rise to a distinction between retracted and non-retracted (pharyngealized) vowels and consonants in Lilooet and some related languages, and the source of the retracted series seems to be a general vowel harmony which managed to give rise to a retracted lateral (the only consonant with the feature). Comparative work on proto-Salishan isn't thick on the ground, so the situation there is less than clear.
In Chilcotin, it's an automatic feature of alveolars (the language, which is Athabaskan, is coronal-rich, contrasting dentals, alveolars and palatals). It is not clear that there is a phonetic difference in the consonants, and one could treat them as the same as dentals, which trigger "flattening" (a vowel harmony process, roughly equivalent to spread of retraction in neighboring Interior Salishan which is the presumed source of this process).
The case of Even seems to be a phonetic development from an ATR system.
In other words, there aren't any clear generalizations.