Loki is the Norse god of chaos. He is a full-blood giant, as both his parents are giants, named Fárbauti and Laufey. He has two full-blood giant brothers as well, Hellblindi and Býleistr. Both his lineage and his tendency to play tricks on everyone make that the has a complicated relationship with the inhabitants of Asgard. He is counted as one of the Aesir gods, most likely due to his blood bond with Odin. It should not surprise us that the Allfather has joined in a blood-bond with Loki, as he has demonstrated devious behavior himself more oft than not.
Loki is the trickster god, but it would be a mistake to consider him to be a purely evil deity. Throughout the stories of Norse mythology, he does get the gods in trouble quite often. Yet, he is also the one that they turn to whenever they need someone to save their skins. All in all, Loki is an agent of chaos and he is both loved and hated for his devious mind. That, and the fact that he lives in Asgard with the other gods, must be the reasons why he is counted among the Aesir instead of the jötnar.
The complicated relationship between Loki and the other Aesir reached its climax when he tricks Hodr into killing Baldr. Váli is the one that kills Loki’s son, Narfi, out of revenge. He then binds Loki with the entrails of his very own son, after which is locked up in a cave. He is locked up in a cave, where a snake of Skadi will drip poison on his face. The remainder of his children had already been banished or locked up. Hel was sent off to Helheim, Jörmungandr had been cast into the sea, and Fenrir had been bound with a magical dwarf-made rope.
Given the events above, it should not surprise any of us that Loki was going to retaliate if he were ever to break free from his imprisonment. That is exactly what happens when Ragnarok starts. Loki is the commander of the giant armies that fight against the Aesir, fighting side by side with his children. Together, they are responsible for the deaths of many gods.
Loki and his armies would turn out not to be victorious in the end. Heimdall and Loki will mortally wound each other and the armies of the giants will be vanquished.