>How do we even know this without even being able to detect it?
We don't.
But we do observe its effects, in that there's large globular and non-uniform distributions of gravity weaving through the universe like blood vessels in meat, with no detectable objects to explain them. There's something there - there's no denying that part - it's just a question as to what, and why it isn't interacting in any observable way, save for gravity.
Well before we observed this, we had the idea of non-baryonic matter. Like anti-matter, it's a phenomenon that should exist as a consequences of physics, but we don't see much of. (Save that, yes, anti-matter's existence, even in nature, is confirmed, while dark matter is still something we're trying to detect.)
Non-baryonic is simply matter that did not bond with the electromagnetic and strong force quantum fields during the early stages of the formation of the universe. It still retains its form, due to being bonded with the weak force and gravitation, being the only two forces through which it can interact with regular matter. It thus affects matter gravitationally, but rarely interacts with any of it, or itself, as it has no bonding mechanism through which to do so.
The observation of these gravitational veins could be explained by the existence of non-baryonic matter being much more common than initially believed. It would explain a lot of other discrepancies in observations, such as why quasars are far more energetic than they should be able to be, given the amount of matter available around them - often outshining their own galaxies by hundreds of magnitudes, and yes, spiral galaxies.
Dark energy, however, is another subject. Its effects, unlike dark matter's, are uniform. You can't remove the effects of dark matter by "tweaking some numbers" - something is undeniably there - but dark energy maybe a better candidate for that sort of fix.
Though, in both cases, no one has come up with a better explanation.