PPI: physical pixels per inch
PPI is a property of the glass: how many physical pixels fit in one inch of the panel. It is computed from the resolution and the diagonal screen size, and nothing else:
ppi = √(widthPx² + heightPx²) / diagonal inches
A higher ppi means a sharper panel, but it says nothing by itself about how Android scales a layout. Two phones with the same ppi can report different densities, and one phone's ppi can stay fixed while its reported density is overridden.
DPI: the density Android reports
DPI, in Android terms, is the density the system uses to convert dp into px: px = dp × (dpi / 160). It is the manufacturer's chosen value for the device, and it is frequently not the nearest density bucket to the physical ppi. That is deliberate: the shipped density is tuned so text and touch targets feel right on that particular panel size.
This is why the find-your-DPI guide reads the reported value with adb shell wm density instead of computing ppi: only the reported value reproduces what the layout engine actually does.
Worked example: Pixel 9
The Pixel 9 panel is 1080×2424 px on a 6.3-inch diagonal, so its physical ppi is √(1080² + 2424²) / 6.3 ≈ 421 ppi. But the phone reports 480 dpi. Its layout width is therefore 1080 / (480 / 160) = 360 dp. If you converted with ppi instead, you would get about 410 dp — a layout 50 dp too wide, and every px size derived from it wrong.