It has something to do with chicken hormones being active in both male and female versions (where with humans, it's latent with the non-dominant one) , and sometimes they're present in pretty much even amounts so a chicken can display both male and female characteristics such as crowing, large wattles and comb and spurs while still laying eggs (bi-sexual).
In very rare instances, you can have a rooster when viewed from one side, and a hen when viewed from the opposite.
In very rare instances, you can have a rooster when viewed from one side, and a hen when viewed from the opposite.