Meaning of the phrase "come out in the wash"

It means that problems or difficulties will be resolved in due course.

AFAIK, it was first used by Cervantes in Don Quixote:

"At least," said Sancho, "your grace
was able to put your lance into its
proper perspective, aiming at my head
but landing on my shoulder, thanks to
God and my ability at leaping aside -
but never mind, it will all come out
in the wash"

[The quote varies based on the translation]

edit

@1006a was kind enough to furnish the original Spanish in a comment:

Pero vaya, que todo saldrá en la colada
[But go on, it will all work out in the wash]


It means that everything will come out. "Come out in the wash" refers to having a stain come out in the wash.

"Fig. to work out all right. (Alludes to a clothing stain that can be removed by washing.) Don't worry about that problem. It'll all come out in the wash. This trouble will go away. It'll come out in the wash." (the Free Dictionary)