ENV variable and global variable gitlab-ci file

Hi Team,

I define ENV variable and global variable in gitlab-ci yml. which value runner will take…?

For ex I have project-A define ENV variable NAME = ABCD
and .gitlab.ci.yaml file also define variable NAME = EFGH

        echo $NAME which value will print..? explain also reason..?