Barrow-wights are wraith-like creatures based on the Old Norse Draugr. Barrow refers to the burial mounds they inhabited and wight is an Old English word for "human being" or "person" (it does not mean "spirit" or "ghost"; it is cognate to modern German "Wicht", meaning "unpleasant person"). Tolkien borrowed this concept from Norse mythology, e.g. Waking of Angantyr and Hrómundar saga Gripssonar.
Evil spirits of some kind (perverted Maiar or possibly spirits of Orcs, fallen Avari, or evil Men), they were sent to the Barrow-downs by the Witch-king of Angmar in order to prevent a resurrection of the destroyed Dúnedain kingdom of Cardolan.
During the War of the Ring, Frodo Baggins and company were trapped in the Barrow-downs, and nearly slain by wights. It has been speculated that Frodo was trapped in the cairn of the last prince of Cardolan.
Other versions of the legendarium
Due to his inspiration from Hrómundar saga Gripssonar, during the writing of The Lord of the Rings (see The History of The Lord of the Rings) Tolkien at first foresaw a link between the wights and the Ringwraiths, initially describing the Black Riders as horsed Wights, but the suggestion that they were the same kind of creatures was dropped in the published work. In the final work there remained a link between them: the wights were now spirits sent by the Witch-king.