What is the basis for creating a depth map for an existing image?

Thanks but I am talking about the depth map options in e.g. GIMP/G’MIC or in the RawTherapee DeHaze function which has a ‘Depth Map’ check box and a ‘Depth’ slider.

Both work on ordinary single images although G’MIC does have some 3D stuff too.