(I have to say that JohnAm is totally correct, just a bit too compact. So I am going to lean in the opposite direction and oversimplify.)
Kant's general approach to things is 'transcendental idealism'. That means that there are ideal forms behind the physical world, but they do not make any sense if totally separated from it. They do not form it and it does not cause them.
A Platonist or someone like Berkeley might think that the patterns of causation we see are part of our mental world because the mind builds the world and imposes various forms of expectation upon it. To some, this implies the physical world is a little less than real.
A total non-idealist physicalist might think that we learn the notion of causation by observation. But as Hume points out, that does not seem quite possible once you look closely enough.
Kant's compromise (which kind of prefigures evolution) is that innate mental contents and reality meet in the middle. There are certain notions that are necessary to understand reality. 'Just enough' of that is built into us by construction. But then those built-in assumptions are triggered by exposure to our particular reality.
We cannot learn that causation is a possible relation between things, no matter how much we observe. But given the seed of that idea, we can readily learn what in particular causes what else, at least to the degree it really matters.
If anything, we do so 'too well', as we often ascribe causal connections that are complete illusions. This is part of the argument against pure idealism. If the mind imposed causation, in the form of projected will, or the Will of God, we might miss some causal relations, but we would be unlikely to assume nonexistent causes as often as we do.