The Black Smoke is an automated security system of unkown origin previously employed by the Island Protector to resolve potential confrontations by force, if a peaceful resolution was not possible at the time. Chronologically, it can be argued that it's first appearance was when the Roman survivors of a shipwreck discovered The Light, and intended to 'harness' it in order to escape the Island. The Island Protectot, the surrogate Mother of Jacob and his brother; the Man In Black, summoned the Smoke to attack their camp and stop them from putting the Light in danger.
As revenge, the Man In Black (who had previously defected to the Roman camp) killed her. When Jacob discovered him standing over Mother's body, he attacked his brother and dragged him to the Cave from where the Light originates. They had been warned never to enter, but in a fit of rage Jacob cast MIB into the Creek, where he floated unconcious into the Cave. Immediately after, the Smoke burst into the sky, creating the illusion that MIB had become the Smoke itself. In fact, it is much more likely that he was attacked and killed by it, allowing the Smoke to project MIB's 'form' during future attacks. It seems that once the Smoke has taken a form it then has access to the person's memories and personality traits. The 'claiming' of the Man In Black is significant to the story of LOST because it also inherited his 'talent' for speaking to members of the afterlife who are trapped on the Island, shown to be true when he was confronted by his Real Mother, who was killed by the surrogate Mother after she gave birth. This is also the reason why the Others were so afraid of Walt's presence on the Island - he too had various 'talents' which would all be very powerful weapons in the Smoke's arsenal had it aquired them, meaning that Walt needed to be taken as far from the Island as possible. The aquisition of MIB's talent allowed it take the form of anyone trapped in the afterlife, and because the Smoke is automated with only a limited sentience it was fooled into thinking that it was once Human after it took the 'data' of the various people in the Island's afterlife. The Smoke evntually broke away from it's duties as the Island Protector's weapon of choice and pursued it's own path, seeking to leave the Island, just as the Man In Black had done. Jacob tried in vain to convince the newly sentient Smoke that the people he brought to the Island were worthy of living there, in order to stop it from commiting genocide, as once the Island was free of people (all potential threats to the Light) it would no longer need to stay. The plan failed. The Smoke continued seeking ways to corrupt Jacob's people and found his 'loophole' (the corruption of Ben) which allowed him to murder the Island Protector by proxy, as the 'rules' (possibly the Smoke's in-built 'instinct' - which it would not understand and fight against through the eyes of it's fake sentience) wouldn't allow it to do so directly. The Smoke then had a better chance of escape by convincing Jacob's possible replacements to leave with him (instinct wouldn't allow this either, he eventually tried to corrupt them all so that they would kill each other). However, Jack, the temporary replacement, outsmarted it and killed it by switching off it's source of power - the Light (not only would there be no need for the Smoke in the event of an Island empty of people - there would be no need for it without the Light to protect, either), rendering the Smoke mortal. Once it was dead, Jack returned to the Cave to switch the Light back on by sacrificing his own life.