Lets see....how to put this?
Lets just say that a chicken knows when it is crowded and has limited movement because it tries to move and cannot get far. This may stimulate the bird to feel discomfort. It may have sore and tender feet from walking or standing on wire and the response to this may be to hunker down to relieve the pain. It may have trouble breathing the dust created by many birds shuffling around in bedding and this stimulates a fear/anxiety response in their body.
Pain, fear and anxiety are all considered emotions by humans but they are just labels to denote a certain response to a stimulus. Basic responses to stimuli of this nature are universal to higher forms of life such as mammals, reptiles, fish, etc. They are all neural responses that require little thought or reasoning.
Yes, I agree that a chicken can feel the warmth of the sun on their outspread wings, the coolness of dusting to their skin, they can feel that their crops are full, that cool water is soothing to their throats. We would call all that happy, content, good, etc. To the chicken all these actions they perform are learned behaviours or purely instinct. I don't believe they get off the roost in the morning planning their day and just how they can make it happier. They just go about being chickens...simple creatures without the burden of higher cognitive function.
Do battery hens know they are battery hens and therefore are lacking what free range chickens have? Nope. They know only basic stimulus~response behaviours. They aren't sitting there feeling sad or envious. They go about being chickens limited to the space in which they live. They eat, they drink, they lay, they peck each other, etc.
They feel the pain or discomfort of close confinement, feeling ill, anxiety as a response to respiratory distress, possibly neuralgia from being debeaked. They will walk all over and even peck at a dead chicken in the same cage without a thought of sadness or remorse.
No one is arguing that chickens are as intelligent as chickens need to be...but are they on par with the whole range of human emotions or cognitive reasoning? Nope. Thank God for that tender mercy!