Here is Shakespeare, in Hamlet, giving his definition of what drama and writing is for...
Suit the action to the word, the word to the
action; with this special observance, that you o'erstep not the modesty of nature: for anything so overdone is from the purpose of playing, whose end, both at the first and now, was and is, to hold, as 'twere, the mirror up to nature; to show virtue her own feature, scorn her own image, and the very age and body of the time his form and pressure.
Here is a modern translation of that
Fit the action to the word, the word to the action, with this special rule; don’t overstep the simplicity of being natural. For anything overdone is not the purpose of acting, whose end, both at the first and now, was and is, to hold, as it were, the mirror up to nature, to show truth in reality, scorn her falseness, and to record the shape and movement of the times we live in.
Art reflects society by recording it. So we can look back and read 'The Red Badge of Courage' to see how people felt in the civil war. We can read Huck Finn or Tom Sawyer to revisit the historic deep south. We can read The Kite Runner to learn what it is like to be an Afghan and what Afghanistan is like. etc etc.
You may be thinking too hard about this 'mirroring'. When we say 'art mirrors life' we simply mean that art records what it is like to be human and the various experiences people have had so that we can look at it carefully.
Sometimes we read or see something that we strongly agree with. I bet you can think of a song that really really goes deep inside you and is important to you because it echoes your beliefs and feelings? That is art mirroring life.
That literature mirrors society is a widely known and generally accepted proposition. But it is seldom a simple mirroring or a one to one correspondence, for good literature is never a case of photographic realism. Literature is rather a complex, creative re-construction of lived reality. Whenever social events & experiences get transcribed in a work of literature, they acquire a different angle, a new perspective, a life & reality of their own.
In Marxian terms, literature belongs to the super-structure which erects itself on the economic base of the society. It is the base which holds the super-structure, but the elements of the super-structure also cast their influences on the base.
Examples of English literature can be examined to explore this complex and multi-layered mirroring. Chaucer's The Canterbury Tales, Shakespeare's tragedies, Ben Jonson's comedies, the Restoration Comedy of Manners, the novels of Charles Dickens, the Problem Plays of Shaw, the poetry of T.S.Eliot, the political theatre of Osborne, Wesker, Pinter & others are some major examples to study this literature-society correspondences.