The literal meaning of the Arabic word "Shaikh" or "Sheikh" is an old man.
It is also applied to a person who knowledgeable irrespective of the age.
The classical scholar Raghib al-Isfahani observed:
شيخ
يقال لمن طعن في السّنّ: الشَّيْخُ، وقد يعبّر به فيما بيننا عمّن يكثر علمه، لما كان من شأن الشَّيْخِ أن يكثر تجاربه ومعارفه
Shaikh: It is said for an old man and since because an old man is more experienced and informed, from that perspective a well-versed / knowledgeable person is also to be called as Shaikh. (Source: Al-Mufradat fi Gharib al-Qur'an)