It is a creature invented by Stephen King for his horror novel by the same name.
It apparently originated in a void containing and surrounding the Universe, a place referred to in the novel as the Macroverse. Its real name (if indeed it has one) is unknown, and it is christened "It" by the group of children who later confront it. Its natural enemy is "the Turtle" another macroverse dweller who, eons ago, vomited up our Universe and possibly others. The Turtle is based on other World Turtle stories, such as Discworld's Great A'Tuin. The book suggests, although never really explains, that It was either a creation of the Turtle or was, along with the Turtle, the creation of a separate Creator altogether.
In its natural habitat, It is a creature made of orange "deadlight"; coming face to face with this light drives any living being instantly insane. When it enters our universe, though, its natural form is that of a massive spider, fifteen feet high. It arrived in our world in a massive, cataclysmic event similar to an asteroid impact, and landed in the place that would, in time, become Derry, Maine.
For millions of years It dwelt under Derry, hibernating for long periods and waking every twenty-seven years, approximately. Its awakening is always marked by an act of great violence, and it takes another great act of violence to send It back into hibernation:
1905-1906: It awoke when a lumberjack named Claude Heroux murdered a number of men in a bar with a huge axe. It returned to hibernation when the Kitchener Ironworks exploded, killing many children engaged in an Easter egg hunt.
1930-1931: It awoke when a group of Derry citizens gunned down a group of gangsters known as the Bradley Gang. It returned to hibernation when the Maine Legion of White Decency, a Northern counterpart to the Ku Klux Klan, burned down an African-American army nightclub.
It is speculated in the novel that these events are actually caused by It, who somehow gains control of the people involved. The librarian Michael Hanlon, the character who does a great deal of research on It, learns by interviewing eyewitnesses that a clown named Pennywise (Its favorite form) or some unlikely creature, like the giant bird seen by Mike's father Will in 1931, was always present at each event. In the intervening periods between each pair of events, a series of child murders occurs, which are never solved. These murders are never reported on the national news, most likely because location matters to a news story - a series of murders, no matter how gruesome, don't really get reported if they happen in a small town.
An important thing about It is that the things It does or is responsible for are never noticed or, if they are, acted on by bystanders. Bill Denbrough, another major character, is sure that this is because It is a part of Derry, or Derry is part of It.
It finally meets its match in 1958 when, in light of a new rash of murders, a group of children, calling themselves the Losers' Club and led by Bill Denbrough, manage to deduce Its existence. This is mainly because Bill's younger brother, George, was Its first victim in 1957. They learn that It can take many forms, but it usually assumes the form of whatever the person confronting it fears the most after luring them to It, in the form of Pennywise the Clown. The kids go after It and hurt it gravely with silver slingshot slugs in an old abandoned house where it lives. It attempts to kill them through a highly unstable schoolyard bully named Henry Bowers, but they track It to its lair in the sewers under Derry. Pursuing them, Bowers's two friends are killed by It and Bowers himself flees in terror. He is later commited to a mental hospital.
The kids discover Its true form and Bill, looking into Its eyes, is transported out of his body and into the void of the universe - It intends to bring him face to face with the deadlights. On the way, Bill meets the Turtle. Before being brought out of the universe to the deadlights, Bill uses all his mental powers to escape back into his body. He mortally wounds It, but It manages to flee before the kids can kill it totally. They make a pact to return to Derry should the murders begin again.
They do, in 1985, and Mike Hanlon (the only one to stay behind in Derry) calls them to come back again. One, Stanley Uris, commits suicide by slitting his wrists in the bathtub, but the rest return, even though they remember very little of what they did in 1958. They eventually return to the sewers and discover what Stan Uris had been the only one to realize before - It is female and, what's more, pregnant. The same thing as before happens to Bill, but this time, he is aided by his friend Richie Tozier, who joins him in the void and whose skill at voice imitation wounds It greatly. Another, Eddie Kaspbrak, dies of blood loss fighting It after his arm is torn off. Bill and Richie return to Earth, and It flees, leaving a trail of eggs behind. Bill destroys the eggs and then he and Richie confront It. Bill, given power by the creator of It and the Turtle, smashes into Its internal cavity and crushes It heart, killing It.