A capacitor can hold enough charge to power led for noticable amount of time even if powered for a brief moment, no logic needed
EDIT: It’s not just a capacitor, it’s a full custom chip, that can’t be software-modified, that keeps the light on for 3 seconds. https://news.ycombinator.com/item?id=42260379