What do you mean by that? Which part?
Because it comes from Proto-Slavic word "město" and most of the letters kept their function and just the Proto-Slavic "ě" (the yat letter) became pronounced "je" sometime in Proto-Czech. Much later (16th/17th century) the mě (then =mje) group became pronounced "mňe" as it is today, but I do not know why.
Or if just ask how the orthography works - it is described in detail in our Tips and notes, Wikipedia articles and else where. The MĚ group is pronounced always as MŇE, unlike BĚ, PĚ, VĚ which are pronounced BJE, PJE, VJE.