City status is a symbolic and legal designation given by a monarch, national or subnational government. A municipality may receive city status because it already has the qualities of a city, or because it has some special purpose.
Historically, city status was a privilege granted by royal letters of patent. Sovereigns could establish cities by decree, e.g. Helsinki, regardless of what was in the location beforehand. Also, with the establishment of federal governments, the new capital could be established from scratch, e.g. Brasília, without going through organic growth from a village to a town.