These are from Immanuel Kant. In philosophy it has to Epistemology - reasoning. Both relate to knowledge, how it is obtained, and as justifications with argument. Language is a key element with both.
Essentially a priori means from the earlier and is 'thought' or derived from reasoning. It is independent of experience. The only thing necessary for it is learning the language for the knowledge. The most common example used is all bachelors are unmarried, thus a single man is a bachelor can be deduced. One does not have to experience being unmarried to have knowledge or know any bachelors. With science it is hypothesis before experimentation and is known as a priori hypothesis. It is pure reasoning.
A posteriori means from the later and results from experience related to experiencing and experienced. For example the most common example is it raining outside now. It results from experience. Most understand this with science as results from experiments or empirical knowledge. It occurs as observed or of observed. It is justification for knowledge seen as evidence at the time of the experiment or after. A new theory with that knowledge may be derived known as a posteriori hypthesis.
There is a third option for justification. That is Immanuel Kant's proposition for synthesis. In that case is when one cannot be independent from another to my understanding.