Math and logic are the only two processes that are completely centered around relations amongst ideas. These operations both consist of blanks that you must fill in with impressions in order to make sense of them. Impressions of our world is what makes us able to put math and logic to good use. Hume looks at how our casual reasoning is based upon the impressions we have of our world. .
Relations of ideas are special due to the fact that the contrary of relations of ideas leads to a complete contradiction. When we look at math, relations of ideas conform to rules that are responsible for the operation that is being performed. If you tried to state something or come up with an answer that did not obey to the rules of the operation then you are contradicting it, which makes your answer false. You can also look at relations of ideas in the fact that when you think of geometrical shape in your mind, you can think of operations to perform on that shape in your mind. It is taking place in your mind, there is no actual tangible triangle at that point. This is a reference of the operations that you would perform on the triangle. Relations of ideas is when you think of the shape and think of the operations you would use. There is nothing that you have to have in your hands to work on this operation in your mind. .
Matters of fact are impressions or memories of impressions. Matters of fact is perceiving something or remembering when you perceived something. They are the effects of our senses and are different from relations of ideas because they have a certain value of truth. When we look at relations of ideas we can tell if it is true or not because its contrary is not allowed. Now when you look at matters of fact you have no contradictions to look at. Perceptions have no contradictions within them or to any other perception. When you state a fact, it is just a fact. You can say something to someone and they can agree with you so that means that your perceptions are alike.