In the USA anyway, "cage free" is a pretty misleading label. It only means that the Cornish-Cross chickens (the popular meat bird) are all raised in a large, long building instead each bird in its own cage. It actually makes no sense to cage meat birds, because logistically it makes feeding and watering the birds more complicated. So meat birds being produced on contract for large chicken suppliers like Pur-Don't (*wink*) are grown in overcrowded houses. "Free range" by USDA standards only means that the birds were allowed access to a small door that only has to be opened for a short time every day. Many works at these factory farms report that they almost never see the birds venture outside. Cornish-Crosses grow such large heavy breasts that their legs cannot support them. This is part genetics, part feed-related. They often injure themselves, and flock loss percentages are very high.
Caging chickens for egg production has a pretty obvious reason behind it. They can't get at their own eggs to break them, and space can be utilized properly if the birds aren't allowed to move around. Also not humane. They "don't need" sunlight in this situation because light is provided artificially.