It certainly doesn’t always get it right - I’ve seen subjects lit by bright sunlight in a nighttime background, or just from a wildly different direction, but within a subject the lighting usually seems consistent.
I’ve wondered the same thing myself, my assumption is that it just correlates how lighting works across millions of training images, much like how it manages to get gravity right most of the time.
I had mine pay out via zelle, so that sweet USD$0.12 went directly to my bank account.