Other forms: figments
When something is a figment of your imagination, it means that you made it up. It's something that might seem real, but is really not.
What does a fig- (not the fruit fig) have to do with something made up inside your head? It has to do with Latin, as usual — both figment and fiction derive from the same Latin word. But it might help to think of figment as a fig leaf — a figment is something flimsy and easily blown away.