David Hume like many thinkers of British Empiricism believed that knowledge comes from sense perception. Unlike other thinkers of this time such as Locke and Berkely who believed that knowledge can go beyond sense perception Hume believed that knowledge is limited to sense experience. Immanuel Kant attempts to answer Hume's critic of knowledge and adjust it. Hume argues that it is impossible to know something fully because it is impossible to know the cause upon which it depends. Kant attempts to go against this with his A priori (from the earlier) and A posteriori (from the later) theories, specifically "synthetic A priori." Synthetic knowledge is something that has happened to you and analytic knowledge is something you have witnessed or observed. A synthetic A priori judge is something you know but have not experienced yet and Kant argues that this is possible. People often refer to this as his Copernican revolution.
Kant believes that things are things because they are put together in certain ways in the mind. If this is true than it is acceptable to think that some of the principles of that structuring could be synthetic and you could know those principles A priori. There are many examples of what Kant considered to be synthetic a priori judgements, all judgements of mathematics and geometry. In natural science such judgements as "every event has a cause." In metaphysics, "There is a God," and "the soul is a simple substance, distinct from the body." In morality, the rule that we should not treat others merely as means to our own ends." These seem to be a priori because you would know them but not from experience and Kant argues they are synthetic because none of them is true simply in virtue of how the terms are related to each other.
Kant is trying to understand these different topics (mathematics, natural science, metaphysics and morality).