Ten thousand asteroids, and every frame you must know which ones touch. Checking all pairs is death; a quadtree splits the space so crowded regions divide and empty ones stay whole — and a lookup skips almost everything. Slide the points (or tap) and watch it subdivide.
A point quadtree. A square holds up to 4 points; add a fifth and it splits into four children, recursively — so dense clusters subdivide deep while empty space stays one big cell. A range query descends only into cells that overlap the query box, so it inspects a handful of points instead of all N. The readout compares brute force (N checks) against the quadtree (only the cells a query touches). A fail-loud self-check throws unless every point lands in a leaf whose bounds contain it and the leaf-point total equals N.
A capacity-4 quadtree on uniform random points (real engines tune capacity, use loose/loose-quadtrees or grids for moving objects). The subdivision rule and the containment invariant are computed exactly.