While it's hard to make definitive statements about when a lot of cities originally became cities, it was first formalised in the 16th century, and at that time all the cities were cathedral towns (or more accurately, they were diocesan cathedrals meaning that churches in other towns in that diocese were administered by that cathedral), and significantly in many cases these cities were smaller than other towns in the diocese. The important part was that these particular towns with cathedrals that had always been called cities for as long as anyone remembered were recognised as cities by the Crown, and other towns were not allowed that status. Later on, Henry VIII created new dioceses and granted those towns (and they also all happened to have cathedrals) city status as well. So, at that time at least, there was a strong precedent that city status and being a diocesan cathedral town were linked, and in fact people were told that cities were cities because of this, even though technically towns became cities only by Royal decree and dioceses were only created by separate Royal decree, but historically both were done at the same time.
This understanding was only really challenged in the early 19th century, when some more towns with cathedrals became new dioceses and their local governments assumed they were now cities and renamed themselves as such. Clearly, the Crown wasn't too worried about this as it took nearly two decades for this to be noticed (and only happened in the context of a Royal visit to one of the cities), at which point there was an act of parliament specifically to confer city status on these new large towns that were already calling themselves cities, again reinforcing the people's understanding that towns with diocesan cathedrals should be called cities.
The interesting stuff happened at the end of the 19th century, when some of the other new diocesan towns that were quite small decided the also wanted the prestige of being a city, but were told they were too small to justify it and rightly complained that other cities were even smaller, but they weren't going to be downgraded to towns because they had always been called cities as long as anyone knew. And then Birmingham, the third largest town/city in the country petitioned to be a city on the basis of its important, and was recognised, at which point the link between city and cathedral was broken down. After that, a few more large towns also successfully petitioned for city status based on size or historical importance.
It can be said that the link between city status and cathedrals was firmly broken in 1974, when all existing cities lost their city status, and towns had to apply for city status along with justifications. This was re-granted to all the existing cities (actually, I've got a vague recollection that at least one didn't bother and lost its city status), and at the same time city boundaries were redefined to include the metropolitan areas that would previously have been considered towns or villages in their own right.
So, in one sense the assertion that towns with cathedrals are cities isn't quite true, and is definitely wrong now, but about hundreds of years this was actually the case. Arguably, correlation doesn't imply causation, but the Crown seemingly made an effort for a long time to ensure that the correlation held to ensure the set of cities was exactly identical to the set of diocesan cathedral towns. So, it's also not a myth.