In the Dark Souls universe, the Undead are people who have died but have been reanimated. Most of these people were sent to the Undead Asylum (the introductory area of Dark Souls) where they were imprisoned to await the end of the world. The living perceive undeath to be a curse or disease, explaining why a majority of the afflicted were exiled and imprisoned in the Undead Asylum.
According to Darkstalker Kaathe, the curse of the Undead was created when Gywn, Lord of Cinder failed to relinquish the Age of Fire, unnaturally extending it by sacrificing his very own soul, delaying the Age of Dark. How an individual can contract undeath is unknown, but it occurs regardless of the victims intentions, in most cases at least. There are a few exceptions like Solaire of Astora who willingly embraces undeath. The Darksign is the symbol that an Undead must be burdened with, signifying their undeath.
In dissimilar fashion to the living, Undead do not perish upon death; but they are instead resurrected at bonfires. However, as time passes Undead slowly lose their sanity and intelligence and undergo a process called “hollowing.” The only way to reverse hollowing is by procuring humanity. Using humanity at bonfires reverses the effects of hollowing but does not reverse undeath. Once an Undead has completely lost their sanity they are regarded as a Hollow. The Hollow are hostile towards lucid individuals, including other Undead. They also die permanently when killed.
Generally speaking, the undead are treated with hostility by the living. Lore suggests that any undead residing in the land of the living were hunted down by the followers of Allfather Lloyd and were sent to the Undead Asylum with no hope of escape. During your travels across Lordran you encounter many characters that mention the stigma they faced from the rest of society before they inevitably left their residences. Not all undead are treated with utmost disrespect though. Paladin Leeroy was the first Undead from the Way of White and was granted the treasures of Grant and Sanctus by his order.