Splitting is a very common ego defense mechanism. It can be defined as the division or polarization of beliefs, actions, objects, or persons into good and bad by focusing selectively on their positive or negative attributes.
This is often seen in politics, for example, when members of the Democrat Party portray members of the Republican Party as narrow-minded and self-interested, and conversely when members of the Republican Party caricature members of the Democrat Party as self-righteous hypocrites.
Other examples of splitting are the deeply religious person who thinks of others as being either blessed or damned, the child of divorced parents who idealizes and idolizes one parent and shuns the other, and the hospital in-patient who sees the physicians as helpful and dedicated and the nurses as lazy and incompetent.
An example of splitting in literature can be found in JD Salinger's Catcher in the Rye. The main protagonist, Holden Caulfield, is mystified by adulthood. To help cope with his fear of becoming an adult, he thinks of adulthood as a world of entirely bad things such as superficiality and hypocrisy (‘phoniness') and of childhood as a world of entirely good things such as innocence, curiosity, and honesty.
He tells his younger sister Phoebe that he imagines childhood as an idyllic field of rye in which children romp and play, and himself as the ‘catcher in the rye' who stands on the edge of a cliff, catching the children as they threaten to fall over (and presumably die/become adults).
Anyway, I keep picturing all these little kids playing some game in this big field of rye and all. Thousands of little kids, and nobody's around - nobody big, I mean - except me. And I'm standing on the edge of some crazy cliff. What I have to do, I have to catch everybody if they start to go over the cliff - I mean if they're running and they don't look where they're going I have to come out from somewhere and catch them. That's all I'd do all day. I'd just be the catcher in the rye and all. I know it's crazy, but that's the only thing I'd really like to be.
In contrast to JD Salinger, Miguel de Cervantes uses splitting to great comical effect as his main protagonist, the self-styled Don Quixote de la Mancha, guides us through a world that he has repopulated with heroes and villains, princesses and harlots, giants and dwarves - with the heroes being the greatest, the villains the most cruel, the ladies the fairest and most virtuous, and so on. ‘Take care, your worship,' cries Sancho Panza, Don Quixote's peasant-turned-squire, ‘those things over there are not giants but windmills.'
Splitting diffuses the anxiety that arises from our inability to grasp the nuances and complexities of a given situation or state of affairs by simplifying and schematizing the situation and thereby making it easier to think about; it also reinforces our sense of self as good and virtuous by effectively demonizing all those who do not share in our opinions and values.
On the other hand, such a compartmentalization of opposites leaves us with a distinctly distorted picture of reality and a restricted range of thoughts and emotions; it also affects our ability to attract and maintain relationships, not only because it is tedious and unbecoming, but also because it can easily flip, with friends and lovers being thought of as personified virtue at one time and then as personified vice at another (and back and forth).
Splitting also arises in groups, when members of the in-group are seen to have mostly positive attributes, whereas members of out-groups are seen to have mostly negative attributes - a phenomenon that contributes to groupthink and, indeed, xenophobia.
Finally, it is worth noting that fairy tales and children's stories feature a number of sharp splits, for example, good and evil, heroes and villains, fairies and monsters. At the same time, some of the greatest characters of literature, such as the Achilles or the Odysseus of Homer and the Anthony or the Cleopatra of Shakespeare, contain large measures of both good and bad, with the one being intimately related to the other.