What's "Shaikh"ing

I have a question about the use of the title (or perhaps name) Shaikh (sometimes spelled Sheikh) in some Middle Eastern cultures. An example is Khalid Shaikh Mohammed, the alleged 9/11 mastermind recently captured in Pakistan. Is the title of Shaikh hereditary? Earned? Bestowed by popular acclimation? Assumed? Is a Shaikh the head of a family group such as a clan or tribe, or meerly a person of esteem? In Khalid Shaikh Mohammed’s case, is it actually his name or a title?

It’s an Arabic term meaning “vererable old man” and is applied to the head of a family or village, or a high-ranking muslim religious official, or the chief magistrate of a town. Not sure about the rest.

Here in the UAE it’s used for princes/male members the royal family. The females are “sheikhas”. It is usually written “sheikh” here, not “shaikh” (in the English press).