For those within the mainstream of the tradition, mathematics and logic are generally considered a priori disciplines. Statements such as "2 + 2 = 4", for example, are considered to be "a priori", because they are thought to come out of reflection alone.
The natural and social sciences are usually considered a posteriori disciplines. Statements like "The sky is usually mostly blue", for instance, might be considered "a posteriori" knowledge.
One of the fundamental questions in epistemology is whether there is any non-trivial a priori knowledge. Generally speaking rationalists believe that there is, while empiricists believe that all knowledge is ultimately derived from some kind of experience (usually external), or else is in some sense trivial.
The use of the term gained foothold through rationalist thinkers like Rene Descartes and Gottfried Leibniz, who argued that knowledge is gained through reason, not experience. Descartes considered the knowledge of the self, or cogito ergo sum, to be a priori, because he thought that one needn't refer to past experience to consider one's own existence.
John Locke, in admitting that reflection is a part of experience, gave a platform by which the entire notion of the "a priori" might be abandoned.
Modern use of a priori began with Immanuel Kant who added the distinction between synthetic and analytic truths to the distinction between a priori and a posteriori knowledge. He argues that propositions known a priori are necessarily true, while propositions known a posteriori are contingent, because a priori knowledge has always been true, according to Kant (e.g. two plus two equals four). A posteriori propositions will depend on external conditions, which may change in time, making the proposition false (e.g. Jean Chretien is Canada's Prime Minister, which was once true but is now false).
Saul Kripke argues in Naming and Necessity, against Kant, that aprioricity is an epistemological property, and should not be conflated with the separate, metaphysical matter of necessity. In support of this argument he offers several pleas to intuition: "Hesperus is Phosphorus" (the evening star and morning star respectively, both (we now know) names for the planet Venus) necessary if true (see rigid designation), but known a posteriori; while, on the other hand, (of the bar in Paris that formerly served as the standard for the metre), "That bar is one metre long" is contingent (we could have taken another length to define the metre, etc.) but known a priori. That is because one metre is defined as the length of that bar, so the bar must be one metre long - it is a tautology.