What makes chickens unhappy?
Firstly, this is how egglaying works, from what I've read on the internet and my own experience in game.
Chickens will usually lay one egg every day, but will sometimes not. I have had three chickens for more than an ingame year, and finding only two eggs in the morning is rare, but not impossible. Ducks, on the other hand, will usually lay one egg every two days. Getting large eggs is affected by the animal's friendship, but it's possible at any level.
Chickens' friendship will, like NPCs', increase slightly every day you pet them, and decrease by a very small amount every day you do not pet them. If the chickens do not have access to any food (grass or hay), their friendship will decrease every day. In the winter, their friendship will decrease slightly every day if there is not a heater in their coop.
However, there is one other factor that does not seem to be related to happiness, but has a big impact on whether they will lay eggs or not. Leaving the coop door open seems to have a large chance to cause chickens not to lay eggs, as I've found my coop (10 animals) with absolutely no items in the morning after a night with the door open, but this does not happen every day.
What happens when you pet them? Do they react positively (heart) or negatively (grumble icon)?