Why cherubim guards (Gen 3:24)? Why the flaming sword?

Such details can only be worked out by making guesses based on the context where the creatures appear. They appear, first, guarding the Garden. Next, they appear atop the mercy seat on the Ark of the Covenant. And then in Ezekiel, they seem to be something like attendants, guards, or even perhaps a kind of beast of burden for God’s throne in the sky. In all three instances, they stand as a kind of guardian of the holiness of God. Yet this is also the role of the seraphim in Isaiah 6. Moreover, the flaming sword also serves a guardian role. Both flame and sword are frequent symbols God’s wrath: “For by fire and by his sword will the Lord plead with all flesh: and the slain of the Lord shall be many.” (Isa. 66:16) Similarly, as Nahum’s prophesy against Nineveh has it, “There shall the fire devour thee; the sword shall cut thee off” (Nah. 3:15). Flame and sword are, of course, two of the most destructive killers in wartime. Thus God declares war on any sinful creature that would approach the Garden.