Barrow-wights are wraith-like creatures
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.
Their nature and origins was unknown, however Tom Bombadil seemed to have complete authority over them. Probably his authority was sourced by the inherent power he had on this region of the world, not the spirits themselves.
Barrow refers to the burial mounds they inhabited and wight is an Old English word for "human being" or "person"; unlike a popular misunderstanding, it does not mean "spirit" or "ghost"; it is cognate to modern German "Wicht", meaning "unpleasant person".
Due to the misunderstanding, DnD has created a monster called "Wight", a kind of wraith.
They were based on the Old Norse Draugr. Tolkien borrowed this concept from Norse mythology, e.g. Waking of Angantyr and Hrómundar saga Gripssonar.
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.