For example, when you want to compute the world space position of a fragment in the fragment shader, you can construct the fragment's NDC coordinates, then multiply by the inverse of whatever transform was used on the triangle that was rasterized to that fragment.
And when this reverse process includes some projective transformation, you have to divide by w after doing that multiplication. Just like if you did the forward process.
But why? My intuition would be that you instead multiply by w (the original one for the fragment, which is stored in e.g. gl_FragCoord.w as 1/w) before applying the transformation, or something like that.
It kind of makes sense that you have to do a perspective divide after applying the inverse projection transform - after all it's going to alter the x,y,z and w components of the result in projecty ways, but I don't understand why this would then correctly give you back the original world space position for the fragment instead of an arbitrary result.