Cadmus, a Phoenician, went to Greece having with him the alphabet and founded a city by the name of Thebes. Thebes was an ancient Egyptian capital city at one time. Cadmus was not an Egyptian.
Phoenicia is not entirely outside the sphere of influence in ancient Greek times. In fact, Phoenicia's (a Greek name) origins have been linked to ancient Crete by many investigators.
I am not a historian, but I think we will never find out the answer to your question, but we have plenty of ideas based on a mixture of what we call mythology and witness testimonies from ancient Greek writers.
The origin of the Greek Thebes is explained in mythology (following a certain cow). However, the origin of the Egyptian Thebes is lost in memory and was created around important mining centres.
I have found out that to identify the meaning of some ancient names, one has to look elsewhere: For example, for the meaning of "mycenae" (ancient Greek name) I found that it means "turtle shell" in the Cree language (North American Indian). The acropolis of ancient Mycenae actually looks like a turtle shell when viewed in the distance.