Pixel density
Pixel density describes how many physical pixels fit into a given length on a panel, often measured in pixels per inch (PPI). Two displays with the same resolution can have different pixel densities if their physical sizes differ.
Higher density can show finer detail, but the apparent size of text also depends on desktop scaling. HiDPI describes a rendering relationship; it is not itself a measurement of the panel's pixel density.
The macOS scaling explanation describes what HiDPI can do on a lower-density panel.
BetterDisplay's UI scale matching uses display dimensions and desktop modes to bring interface sizes closer across displays. Incorrect physical-size reports can affect that calculation. See HiDPI and UI scale matching.