It's called personification.
The term for assigning human attributes is anthropomorphism. Examples are fables and animal cartoons.
personification
personification or anthropomorphism
When an author gives human qualities to an animal in a story they anthropomorphize it.
Actually, personification gives human qualities to non-human things.
something that has human like qualities
The term for giving something human qualities is "personification." This literary device is often used to create vivid imagery and evoke emotions by attributing human characteristics to animals, objects, or abstract concepts. For example, saying "the wind whispered through the trees" gives the wind a human-like ability to whisper.
Actually, personification gives human qualities to non-human things.
Chremamorphism is giving characteristics of an object to a person, e.g., "she shined upon him with her eyes" gives qualities of an object, like a star, to a person.
Personifaction.
Personification is the literary technique that gives a plant or animal human qualities. It involves attributing human characteristics to non-human things, making them relatable and easier to understand in a literary context.
Personification is when an author gives in inanimate object human qualities. example: The leaves danced in the wind.