Passive: slow requests
Performance Detective records requests that cross a time threshold, how much of it was database work, and — when SAVEQUERIES is on — the exact slow query shapes. High memory with few queries points at page builders or image work; hundreds of queries usually means an N+1 loop.
Active: measure a page
The probe (in Testing tools) runs one timed internal request and breaks it down: total and PHP time, database time and its share, peak memory, the five slowest queries with the file responsible, and any duplicated queries. It tells you not just that a page is slow but WHERE the cost is — plugin, theme or core.