The process of transforming 3D coordinates to 2D pixels is managed by the graphics pipeline of OpenGL.
In OpenGL everything is in 3D space, but the screen or window is a 2D array of pixels so a large part of OpenGL's work is about transforming all 3D coordinates to 2D pixels that fit on your screen. Hello Triangle Getting-started/Hello-Triangle