So for the robber to gain such information about the victim bitcoin holdings, such information may have leak from the victim to another Person close to him and from there the worked on his wallet balance to know how much bitcoin he actually owned.
Leaks like this can happen even if you don't tell anyone, centralized exchanges have people who can leak such information.
Same goes to the tax offices when you pay tax from cryptocurrency.