GROUP BY splits the rows
GROUP BY takes the rows and sorts them into buckets by a column. An aggregate then runs once per bucket instead of once over everything. So COUNT(*) GROUP BY city is not one total, it is a count for each city. The column you group by is the thing you are counting by.
Only group columns and aggregates
In a grouped query, every column in SELECT must be either grouped or inside an aggregate. If you write SELECT name, COUNT(*) GROUP BY city, the name is ambiguous, one city has many names, and the database has to pick one. That is a trap: it may run and hand you a name that means nothing. Group by what you want per line, and aggregate the rest.