Hume made a very interesting case that simple perception of two things happening in close association with each other does not prove that one caused the other, and that in fact the idea of causation as a whole has problems.
Kant responded to this by saying that, in point of fact, that is a moot point because we never simply have a disconnected, abstract, point of view but always one that's contextualized within human cognition which produces causation as part of a greater set of assumptions that makes up a worldview that is mostly functional and verifiable.
Kant makes the point that there should be something more than just chance association to our ideas about things like causation, even if what it actually is is not clear, because there are a great many things that we can in fact know or deduce without direct observation that also prove to be correct when we find them in nature...math being a prime example. Without any observation of the external world, you can work out complex algebra that you can then find working in the world itself.
If all associations between ideas are just opinions made after the fact, how is that possible?
Kant is in effect saying that while the example of the billiard balls and causation might be superficially appealing, that if one truly took that logic and applied it to all of the things that we deal with on a daily basis, most if not all, of things that we take for granted, that do work to a certain degree in the actual world, would be invalidated.
Now, Kant does not suggest that what we think is the explanation of these things actually is the case. In point of fact, he suggests that to a very large degree the categories that we use to evaluate these things are the product either of culture or of a sort of semi-arbitrary biological programming. Yet, although they might be the product of something that is, in the end, programming and filters that are "false", or not what they appear to be, in and of themselves, they do appear to interface with the actual world and produce actual results, even if imperfectly.
That sort of mysterious connection between the categories of thought and the ultimately unknowable truth of the world, unknowable because it's very, very, difficult to truly go beyond our categories of thought themselves, is what makes Hume's point invalid.