what's the difference about light(),& lightmode()

the function glLightfv(GL_LIGHT0, GL_AMBIENT, ambient) can set the ambient light.
at the same time the function,glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient) can also set the ambient light. So what is the difference.

GL_LIGHT_MODEL_AMBIENT adds ambient lighting whether lights are enabled or not.

The other one is part of the light’s state. Each light has its own ambient term.

Nope! That function sets the ambient component of LIGHT0. Isn’t it obvious from the parameter list?

This function sets a GL_LIGHT_MODEL_AMBIENT parameter of “global” lighting model. As V-man said, you can have an illumination effect without any light source in your scene by setting this parameter to value different than 0. Be aware that GL_LIGHT_MODEL_AMBIENT interacts only with ambient component of the material.

GL_AMBIENT component of each particular light source also interacts with the ambient component of the material, but spotlight effects as well as attenuation affects this interaction.

If you have the chance, read chapter 5 from the Red book (OpenGL Programming Guide).