Abihu and Nabadh, the two eldest sons of Aaron, the brother of Moses, offered an improper sacrifice to the Lord and were themselves consumed in the flame. They left no offspring.
Pinchas was a grandson of Aaron, but he was not a 'Kohain' (part of the hereditary priesthood, because his father was elevated to the Priesthood after he was born). However, he was raised to the Priesthood by the Lord after he killed Prince Zimri who was co-habiting with the beautiful Kosbi.
Pinchas' action was correct because the Lord approved it even though the Law did not. In other words, by reading the Bible we know that it is algorithmically verifiable that Pinchas acted correctly- because that is what the Text says- yet his action is not algorithmically computable by the Laws revealed in that same text- i.e. there is no process of halachic reasoning that can arrive at the same conclusion.
Thus, at least on one interpretation, it is a paradoxical sort of action- a halachah vein morin kein- a teaching which, if known, prohibits the very action it would otherwise enjoin.
When Pinchas realized the terrible nature of what he had done, according to a mystical interpretation of the Bible, his soul fled him in fear. The Lord then caused the ibbur (entry into his body) of the souls of Nabadh and Abihu who thus became the spiritual progenitors of the Kohain- or Cohens.
Interestingly Pinchas is said to lose this ibbur at a later time for somehow failing to avert the tragedy of Jephthah sacrificing his own daughter as a holocaust to the Lord as a result of a rash vow. In other words, the Hassidic commentators are making clear that Jephthah's fire sacrifice was not legitimate or ordained by God, just as Abihu and Nabadh had made an improper sacrifice.
The interpretation given by the Zohar, or other mystical sources, may seem bizarre or superstitious to a lot of ordinary Christian people. However there can be no doubt as to the humane message of the Rabbis which we can summarize thus
1) Yes, Abihu and Nabadh did something improper from the ritual point of view. Maybe they'd had too much wine. But their intentions were good and so though they perished in the flesh yet the Lord's mercy was upon their Spirit. They could still serve the Lord- which was their only desire.
Thus, on this interpretation, from the Spiritual point of view, the Cohens- who are their descendants in the direct male line- need not fear that the Lord will judge them too harshly for some small ritual mistake or over hasty halachic decision- i.e. there is no grounds to hold Judaism to be a 'fossil' religion inculcating Kantian 'heteronomy'. On the contrary, the teaching of the Hassidic Sages is that Autonomy, Creativity, unremitting Zeal for Universal Welfare is what is pleasing to the Lord. The nightmare vision of a capricious God who punishes you for an unknown or unintentional crime has no place in our reading of the Old Testament because the keepers and transmitters of that text- who surely know more about it than ordinary people like you and me- have given a far more closely reasoned and hermeneutically rich interpretation which we can all feel to be more in consonance with the promptings of our own humble and heartfelt Faith in our Creator.
2) Political assassination, or Religious persecution or whatever it was that motivated the slaying of Zimri and Kosbi- though perhaps 'necessary' in some sense, is nevertheless very strictly forbidden precisely to those who know of this legal precedent and who might use it to justify fanatical persecution, or even genocide, of other peoples.
The paradoxical halachah here does not have the effect of crashing the whole deontic system, rather it enables it to evolve in a more humane manner. Yet, from the logical point of view, this is a very difficult problem. After all, the Rabbis say if we break one law we break all laws. If we slay one person we slay all humanity. Furthermore, though ignorance of the law can be an excuse, surely knowledge of it can never be so. Yet, there are situations where something which is enjoined is forbidden because it is known to be enjoined. This paradox resolves itself under the gentle guidance of the Rabbis who show that the only way to escape from the quicksand of Legalism is through moral and spiritual evolution- by opening oneself to the ibbur of the self-less tzadikkim. I have written more about this here.
3) The concern shown for the daughter of Jephtah indicates that the truly enlightened person- even if born in barbarous times, when the weaker was enslaved by the stronger- rejects the creed of Male supremacy. It has no place in Religion and Spirituality.
One interesting aspect of the manner in which the Hassidic Sages enrich our reading of the Bible is that, like Umaswati, they formulate the problematic of 'incarnation' (ibbur is actually more like partial incarnation as found in the Mahabharata) as a 'matching problem'. Essentially, a resource is cached in a liminal state- like the Bardo of the Tibetans or the Barzakh of Ibn Arabi- so that it can be drawn upon to resolve paradoxes in a manner that 'climbs the local hill', on the relevant Hermeneutic landscape, so as to grant the reader an expanded Moral and Spiritual horizon.