On iPhone/iPad, where are the screenshots of terminated apps stored?
They survive a restart so they canonically exist in storage.

Of course, everything you see on screen has to be in RAM, too; so the answer is both.