Out of the Frying Pan, Into the Fire

What does the idiom “Out of the Frying Pan, Into the Fire” mean?

Definition:

One problem has been solved, but it’s been replaced by a worse one.

For example:

“We dealt with the legal issues surrounding our advertising, but now one of our products has been implicated in poisonings. Out of the frying pan, into the fire, I guess.”