These two phrases mean basically the same thing. James uses them to emphasize that anything good that a person has comes from God. (See: [[rc://en/ta/man/translate/figs-doublet]])
This expression pictures God as an unchanging light, like the sun, moon, planets, and stars in the sky. This is in contrast to shadows here on earth that constantly change. AT: "God does not change. He is as as constant as the sun, moon, and stars in the sky, rather than like shadows which appear and disappear on earth" (See: [[rc://en/ta/man/translate/figs-simile]])