Rakshasas, demonic man-eaters, come from Hindu cosmology. Because the historical Buddha was from India, a number of ideas from Hinduism informed Buddhism at its inception.
Rakshasas appear in the Maha Samaya and Alavaka, ancient Buddhist texts, in the latter of which Buddha convinces the demon to give up its evil ways and strive for enlightenment.