What it changes
Each major clause (SELECT, FROM, WHERE, GROUP BY, ORDER BY) starts on its own line. Selected columns go one per line, joins are indented and AND/OR conditions line up under WHERE. Subqueries in parentheses are indented one level.
What it never changes
The text inside string literals, quoted identifiers and comments stays exactly as you typed it, and function names keep their case. Formatting only changes whitespace and keyword case, so the query means the same thing afterwards.
Limits
It understands standard SQL used by PostgreSQL, MySQL, SQLite and SQL Server for everyday queries. Vendor-specific syntax such as procedural blocks may keep its original line breaks. Always run the formatted query against a test database before relying on it.