At the beginning of parashas Acharei, the Torah briefly mentions the deaths of two of Aaron’s sons, Adav and Navihu, whose lives were taken by the L-RD, when they approached near to Him (Leviticus 16:1). Immediately afterwards, the H’Shem commands, in regard to Aaron, “that he not come at all times into the the holy place within the veil, before the ark-cover which is upon the ark; that he die not; for I appear in the cloud upon the ark-cover” (Leviticus 16:2, JPS 1917 Tanach).
The juxtaposition of this admonition along side the mentioning of the deaths of Nadav and Avihu hints to one reason why they were consumed by fire: H’Shem’s warning to Aaron, not to enter at all times, implies that Nadav and Avihu made an unbidden entry into the Holy of Holies, for which their lives were taken. For, “The L-RD thy G-d is a devouring fire” (Deuteronomy 4:24, JPS 1917 Tanach).
Next, the Torah begins to relate the various details of the Yom Kippur service: “Aaron shall come into the holy place” (Leviticus 16:3). Only the Kohein Gadol could enter the Kadosh Kadoshim (Holy of Holies), and only on one day of the year, the Day of Atonement. The Sages ask, why are the deaths of Nadav and Avihu are juxtaposed with the Yom Kippur service: In like manner that the Yom Kippur brings atonement, so does the death of the righteous also bring atonement” (Yerushalmi Yoma 1:1). Even though Nadav and Avihu were consumed, the Torah credits them as righteous (Leviticus 10:3), because of their intentions to draw close to H’Shem. So, the juxtaposition of their deaths with the Yom Kippur service points toward the understanding that the death of the righteous atones for sin.
The nature of atonement may be better understood in light of the following commentary: “For the life [nefesh, soul] of the flesh [basar, body] is in the blood; and I have given it to you upon the altar to make atonement for your souls; for it is the blood that maketh atonement by reason of the life” (Leviticus 17:11, JPS 1917 Tanach). Rashi comments on ci nefesh habasar, “for the life of the flesh” of every creature, “not only of animals brought as sacrifices, is dependent on its blood (badam hiy), and it is for this reason that I have placed it [on the altar] to make expiation for the life of man: Let life come and expiate for life” (Rashi, commentary on Leviticus 17:11, sefaria.org).