* He might have known the Baudelaires' parents: It's possible Count Olaf knew the Baudelaire parents personally and was aware of their wealth. This could be through a social connection or a past business deal gone wrong.
* He could have been a con artist: Count Olaf is a notorious con artist. He may have simply heard rumors about the Baudelaires' fortune and used his skills to manipulate the situation to his advantage.
* He might have been tipped off: It's possible someone else informed Count Olaf about the Baudelaire fortune, potentially someone who was aware of the will and the children's inheritance. This could be a disgruntled relative or a hired informant.
The most likely explanation is that Count Olaf simply assumed there was a fortune. He's a greedy and desperate character who sees the Baudelaires as easy targets. He's willing to take risks and use his manipulative skills to try and obtain their wealth, regardless of the truth.
The books intentionally leave some details vague, allowing readers to speculate and draw their own conclusions about Count Olaf's motives and knowledge.