Lightning in a bottle (also known as catch lightning in a bottle or lightning in a jar) is an idiomatic expression used in situations where a very unlikely or lucky success is achieved.
It can also be used to say there is a difficult challenge ahead.
Sometimes the expression is said about things that don’t hold up for a long time, or illusive.