GPUs win when a query can be decomposed into thousands of identical operations on independent data which can be run in parallel, which corresponds well to OLAP database workloads (but not OLTP ones), although in practice it really only corresponds to very large OLAP workloads with multiple chained compute-intensive operations (which make it niche in practice).
Analytical queries are dominated by scans, filters, aggregations, and joins over columnar data. Something like `SELECT region, SUM(revenue) FROM sales WHERE year = 2025 GROUP BY region` over a billion rows is very parallelisable: every row gets the same predicate and the same arithmetic. A GPU can throw tens of thousands of threads at that (memory bandwidth is the other half of the story - an H100 has ~3 TB/s of HBM bandwidth versus a few hundred GB/s for a CPU socket, and scans are bandwidth-bound workloads).