Municipalities are creations of your state government. If you search your states governing documents (state constitution, statutes, acts, compiled laws) you’ll find sections dealing with the establishment of local governments. Each state is different and most have multiple types of cities and counties.
Recently in Missouri a circuit judge upheld a county-wide voter approved county charter amendment proposed by initiative to restrict the use of red light cameras. The initiative was popular, it passed with over 72% support. Several cities and a couple taxpayers (who also happen to be elected officials in some of the cities) challenged the ability of the county to stop cities from using red light cameras. The court sided with citizens, you can read the judgment at the link below.