As there is no explanation provided in the episode, my answer is based purely on logic and [probable] understanding of the behavior of Dark matter.
Because, one of the best places to find Dark matter could be rocks
Based on our current knowledge on Dark Matter, we assume that:
Dark matter is a hypothetical form of matter that is thought to account for approximately 85% of the matter in the universe, and about a quarter of its total energy density. The majority of dark matter is thought to be non-baryonic in nature, possibly being composed of some as-yet undiscovered subatomic particles. Wikipedia
As you say, Dark matter is undetectable by EM waves and by any other current methods known to mankind. And it seems as if this is most likely the case in the 23rd century too (the period in which Star Trek: Discovery is set in).
However, recent studies have revealed that :
Dark matter may occasionally interact with minerals in the earth (or any solid celestial body as a matter of fact), leaving telltale tracks that physicists hope to decipher.
[Link to the actual paper here]
Two possibilities arise as to why Tilly thought there might be traces of Dark matter in the asteroid:
- It could be possible that the theory that, Dark matter can be traced in rocks and minerals, might have been proven by the 23rd century and Tilly happened to follow protocols to analyze the asteroid sample to detect dark matter;
OR
- Although Tilly is an ensign, she has had a lot of experience aboard the Discovery. It is possible that she may have tried to analyze the asteroids. And since nothing showed up on the electromagnetic or optical scans (due to the interference from the pulsar or other reasons), it was a logical guess that there may be traces of dark matter in the asteroids.
Thus for Tilly to assume that they might get hold of Dark matter by studying the asteroids may be a well-studied assumption based on logic.