Hume is a classic, consistent, empiricist. He thinks that all ideas come from experience, because they all come from what he calls impressions. Now these impressions are experiences, however, some of them come from within ourselves as opposed to the five exterior senses. Second, he thinks that all justified beliefs are justified through experience, except for what he called relations of ideas. What relations of ideas were were simply how our ideas are related to one another. So, for example, you could know that all bachelors are unmarried without interviewing any bachelors to find out their marital status, because that is a matter of how we define the word "bachelor." He also asserts that all mathematical knowledge is just the knowledge of definitions. But we can't know anything about, say, whether something exists or not based on how we define the word. So attempts like the ontological argument to show that God must exist because of the way we define "God," are bound to fall flat. On the other hand, any knowledge that might lead us to conclude anything about what is real outside of our own minds, according to Hume, has got to come from experience.
Rationalists think that we can have knowledge of the world outside of our minds through reason, independently of experience. Kant, for example, thought that we could deduce our moral duties through rational reflection and use of the Categorical Imperative. Hume, on the other hand, thought morals derived from feelings.
Hume calls what we can know apart from experience relations of ideas, and what we need experience for matters of fact. This is called, in philosophy, Hume's Fork.