Media queries like @media screen and (min-width: 700px) and window.innerWidth use css pixels. At first, when mobile devices were really 320 pixels, css pixels and real pixels were the same. Now new devices with a resolution of 800 pixels and the same size display 320 pixels css.
And it's really good for developing backward compatible websites. Essentially, @media screen and (max-width: 480px) can be translated into: Small, given the eyes on the screen distance and screen size (in meters not pixels).
So, the css pixel acts as a control measure the most.
Real pixels, dpi, type and orientation of the screen may be available or will be accessible using multimedia queries. But it may be an anti-pattern to use.
Also don't forget the viewport meta tag.
source share