Personification is a literary technique that gives human characteristics to inanimate objects or non-living things that would otherwise not experience emotions, or other human responses to events. The purpose of this is to increase the reader's interest in the story and keep his or her attention. In addition, providing human characteristics to anything -- whether it is a tree or a piece of machinery -- immediately encourages the reader to relate to the thing being described, and can evoke emotions such as concern or sympathy. As with many other literary techniques, personification helps to make the text feel more alive and vibrant, like all the details of everyday life.
It may be best to explain the concept of personification with an example. If an author says the grasses in a field are dancing in the wind, for example, this is an example of personifying the plants. The grasses are clearly not dancing, they are simply moving in response to the wind currents, but saying they are dancing evokes an image of nature that is easier to picture and relate to. Saying an alarm clock is beeping angrily is another example of this. The alarm clock isn't angry, but the person listening to the alarm clock is perceiving it that way, and this helps to set the tone for the story. The author is indicating that the person is probably not too happy to be waking up in the morning, for instance.
These are just a few basic examples of personification, but they do help to illustrate the reason an author might use this technique. One of the cardinal rules of good writing is to "show, not tell," and personification is one of the best ways to convey a mood or image without directly saying it. Describing the grass as dancing across the field, for instance, may convey an image of a beautiful, peaceful field without actually having to describe the field as being beautiful or peaceful.
Another reason authors use personification is to make the story more interesting and engaging to the reader, making it more likely they will keep going. Describing something this way forces the reader to visualize it, which brings him or her deeper into the story. In some instances, personification may also make the reader think about things differently, or gain a new perspective. This technique is often used in advocacy campaigns, for example, because people are more likely to want to care for something that they experience an emotional response to.