Like a sibling commenter, I've found this pretty hit-and-miss too.
Something like Outlook or OneNote will restore its state reasonably well, as will Safari/Chrome/Edge/Firefox. Others, like Activity Monitor, Enpass, and iTerm2, decide to "helpfully" open a window for me even though the previous state was "running with no windows open" (which is perfectly valid for many applications).
Something like Outlook or OneNote will restore its state reasonably well, as will Safari/Chrome/Edge/Firefox. Others, like Activity Monitor, Enpass, and iTerm2, decide to "helpfully" open a window for me even though the previous state was "running with no windows open" (which is perfectly valid for many applications).