A municipal government gets its power to pass laws through a charter or a law of the state/provincial or federal government which specifies what things the city may regulate through bylaws.

City Bylaws