There have been any number of versions of The Phantom Zone over the years, whether it's on TV (Smallville), the movies (Superman, Man of Steel), or of course in the comic books. The pilot episode of Supergirl describes it as a region of space where time doesn't pass, and the young Kara is trapped there for 24 years. She's asleep during that period though which is why she doesn't realise that she's ended up trapped and is obviously why she doesn't age. How her ship is suddenly freed isn't revealed and might just be an ongoing mystery. Later in the episode, it's revealed that Kara's ship brought with it those who were imprisoned in the Phantom Zone. They were being kept in Fort Rars - the spelling might be wrong, but that's how it's pronounced anyway - and crash landed on Earth at the same time the young Supergirl did. The unnamed villains have since been in hiding across the Earth.