Shader input position.w, what is it for?

Hello everybody!
So I stumbled upon this neat snippet of code here:

float2 WIN_SCALE = float2(_ScreenParams.x/2.0, _ScreenParams.y/2.0);
//frag position
float2 p0 = WIN_SCALE * IN[0].pos.xy / IN[0].pos.w;
float2 p1 = WIN_SCALE * IN[1].pos.xy / IN[1].pos.w;
float2 p2 = WIN_SCALE * IN[2].pos.xy / IN[2].pos.w;

This is inside of a geometry shader, hence the input array.
I figure that this code transforms vertex positions into screen space vertex coordinates (as gl_fragCoord would do?) Now, multiplying the vertex position with the halved screen size is quite self explaining, but the division at the end is what I am still wondering about.

I guess pos.w holds information about the depth of a vertex (drawing order). But that is really only an uneducated guess based on the fact that deleting or manipulating the division resulted in many artifacts on edges of spherical objects, where vertices are particularly close to each other.
So can anybody enlighten me as to what exactly w contains?

Thank you in advance!

They’re 4D homogenous coordinates, so the w coordinate implies whether you’re talking about a 3D vector or a 3D point - see here for a better explanation: Graphics Shaders: Theory and Practice - Mike Bailey, Steve Cunningham - Google Books