Why do we use Difference RGB to grayscale function?
There are different color spaces. Each of them has different coefficients for calculating gamma-corrected luma from gamma-corrected RGB values. You have listed coefficients for calculating luma according to ITU-R BT.709, ITU-R BT.601 and NTSC color spaces. There are many others as well, like BT.2020 used in consumer TVs for Wide Color Gamut.