From birth, the duckling appears different from the other ducklings and is told that he is ugly, making him an out group who does not follow the norms of a duckling.
The ducklings are told the norms of proper ducks. The other animals, including other ducks, harass and attack the ugly duckling, reminding him of his ugliness. The other animals threaten the duckling by "wishing the cat would get him" and the duckling learns that he can't do anything about people hating him because he is ugly.
The duckling runs away from his family. He is almost with some geese killed by gunshots and a dog, but the dog ignores him. The duckling assumes this is because he is an ugly duckling, a thought process formed by the cognitive dissonance between the ducklings internal perception of self as not a duckling vs his environment's telling him he is an ugly duckling
The duckling is taken to a cottage, where a hen, cat, and mistress reside. The norms of the cottage are defined by the cat and hen and their specific roles. Anyone who does not fit these norms and/or do the things they do cannot talk "when sensible people are speaking." The duckling continues to lose self-esteem.
The duckling runs away from the cottage to a small pond area, which was quiet "because of its ugly appearance", in reference to the duckling's own learned ugliness through cognitive dissonance. It sees a flock of swans above and calls to them, feeling a connection to them and a need to belong with them.
The duckling follows the swans and asks for them to kill him because he is so ugly, a learned helplessness developed from the amount of harassment he received from assumed peers. Instead the swans embrace him and the he sees his reflection in the water as that of a beautiful swan.