The grooming habits of birds are called "preening."
A chicken's feathers are composed of many long, thin structures called barbs. These barbs are held together by even smaller zipper-like structures called barbules. Sometimes these structures pull apart, which makes the feather ineffective for insulation and waterproofing. A chicken runs its feathers through its beak when it preens, which forces the barbules together again and allows the feathers to serve their purpose.
The photograph above shows the barbs branching off the main shaft of the feather. On each barb are thousands of tiny barbules, which are too small to be seen in this picture.
Chickens also have to keep their feathers oiled to prevent them from becoming brittle and to help with insulation and waterproofing.
A chicken gets oil from a gland located at the base of its tail feathers. This gland is called the uropygial gland, or preen gland.
The preen gland secretes an oily/waxy substance which the chicken spreads over its feathers with its beak. If you watch your chickens preening, you will see them periodically rub their beak on an area by the base of their tail to get more oil from their preen gland.
Preening can also be a social activity. Chickens will certainly preen on their own, but they seem to prefer doing it as part of a group. It is not uncommon to see an entire flock of chickens preening at the same time.