Metaphysics consists of knowledge apprehended by pure reason. By definition, metaphysics studies what is beyond experience. The Greek root meta means "beyond," so "metaphysics" literally means "beyond physics." Like mathematics, metaphysics is an a priori body of knowledge.
The distinction between a priori and a posteriori ways of thinking is that the former are drawn from pure reason and the latter are drawn from experience. Kant goes on to draw a second, even more important, distinction between analytic and synthetic judgments.
The predicate of an analytic judgment is contained in the concept of the subject: the predicate, then, is simply an analysis of the subject concept. "All bachelors are unmarried" is analytic: being unmarried is a part of the concept of "bachelor," so saying that all bachelors are unmarried doesn't add anything to our concept of "bachelor"; it just clarifies the definition.
The predicate of a synthetic judgment, on the other hand, adds something new to the concept of the subject: it synthesizes two different cognitions. "All swans are white" is synthetic: we can know what a swan is without necessarily knowing that it's white, so learning that swans are white is an additional cognition that we can attach to our concept of "swan."
All analytic judgments are a priori, since they consist simply in the analysis of concepts and do not appeal to experience. Synthetic judgments, on the other hand, can be either a priori or a posteriori. Kant classifies synthetic judgments into three types: judgments from experience, mathematical judgments, and metaphysical judgments.
Judgments from experience are synthetic a posteriori since they are pieced together (synthetic) from the objects of experience (a posteriori).