This is also the case for pigs chickens and sheep.
How to see light levels in minecraft. There are 16 light levels specified by an integer from 0 the minimum through 15 the maximum. F3 l 0 9 a f can show all blocks below a particular light level. The sky and certain blocks. They also had coresponding color to the light level with yellow being ll 7 and red 7 mob spawnable.
Light may come from two sources. The light level determines if hostile or passive mobs will spawn. For example with f3 l 7 all blocks with a light level 7 and down are highlighted. The sun is the main source of light in minecraft.
F3 l can be used to toggle a sort of heat map that shows all blocks of a light level in one colour and another lioght level in another colour etc. Might have ben a mod as the person was playing with a mod pack installed. F3 c shows all blocks with a light. I remember seeing some form of debug screen where one was able to see a nice overview of lit up blocks by covering the top of them in thin x s.