When you enter the Schengen area with a transfer flight, you get the stamp at the first entry point. For example if you depart from Beijing and arrive at Rome with Warsaw as a transit, you get the stamp at the border control of Warsaw Airport.
However, how about when you exit out of the Schengen? Suppose that you depart from Rome and arrive at Beijing with Warsaw as a transit, do you get the exit stamp at Warsaw, or Rome? And in this case, is my passport checked only in one border control?
The potential situation why this matters:
Suppose that I have a working and holiday visa for France, and stay there for 1 year. Then I finally get out of France, but since the direct flight is expensive I decide to buy a ticket to Beijing with Frankfurt as a transfer. In this case, if it is at the Frankfurt border control that my passport is checked, I would likely get caught as overstaying. So I must make sure it must be in France where my passport is checked; otherwise I must use a direct flight.