There are two schools of thought. Fairies as Gods – similar to Greek gods or fallen angels.
Paraphrasing Dr. Carolyn White, The History of Irish Fairies;
The divine folk, Tuatha De Danann from the mother goddess Dana, were gods from Greece. They came to Ireland in a magic mist that hid the sun and them for three days and three nights. The mortal race known as the high Milsian race, attacked and prevailed. An agreement was struck between gods and men. The Mils would inherit the earth’s surface and the defeated Tuatha De Danann would enter the sea caves and the bowels of earth.
The sidhe, or fairies, have retained their godly powers. While the mortals won the battle, the fairies had the upper hand as they controlled the elements. At their will crops prospered or withered. The mortals appeased the gods and held fairs where the gods were honored. This meant the fairies would protect the crops, ensure good fishing, and guaranteed protection from invaders.
As for fallen angels, during the fifth century when Christians came to Ireland, they needed to discredit the mortal belief in the Tuatha De Danann. The stories were told that the fairies were fallen angels who, during the heavenly revolt between Lucifer and God, were indecisive. God banished them to earth for they were still too good to be banished to hell.
When I started reading about the origin of fairies it was amazing what and how all this came about. It really is fascinating. Each of these thoughts is collaborated by various readings in Irish folklore all over the web.