What is the meaning of [A blessing in disguise]

a good thing that seemed bad at first