If you’re walking down a city street and suddenly a goat appears out of thin air, then it’s a big surprise. Out of thin air means it’s unexpected, or seems like it came out of nowhere.
When something shows up out of thin air, it appears suddenly and dramatically. You can use this phrase to describe a physical appearance, like how a magician makes a rabbit appear out of thin air. It can also describe ideas, thoughts, or stories. If you didn’t really see a city goat but said you did, then you pulled that story out of thin air. Another way to say this is out of the blue.