GROUP BY puts rows with the same value into one group, then runs your aggregate once per group. One query gives you orders per status, customers per country, or revenue per month:
SELECT category, COUNT(*) AS products
FROM products
GROUP BY category;
Every column in SELECT must either be listed in GROUP BY or sit inside an aggregate. This rule causes more errors than any other here. SELECT category, name, COUNT(*) ... GROUP BY category fails, because a category has many names and the database can't pick one. PostgreSQL, SQL Server and the database here stop with an error; older MySQL setups return any one of the names without a warning.
You can group by several columns (GROUP BY country, city) to get one row per combination. Groups come back in no particular order, so add ORDER BY when the order matters. You can sort by an aggregate too: ORDER BY products DESC.