Since every idea must, therefore be pulled from an impression, we must inquire into the source of our ideas and the impressions from which they are derived. Now, each idea and impression is separable from each other, any connection that we make is the result of an association that we manufacture ourselves. Experience gives us the ideas and the awareness of the associations between them. Relations of ideas are formed wholly in the mind. They have no external reference.
Matters of fact are beliefs that claim to report the nature of the existence of things.
This is the basis for Hume's distinction between a priori and a posteriori knowledge. He concludes that mathematical and logical knowledge rely on the relation of ideas so they are uncontroversial, but uninformative. More controversial matters of science rely on matters of fact. They are the basis of genuine information. In order to learn, we must suppose that our past experiences bear some relevance to present and future cases.