Specifically, you are exempted from the airport transit visa requirement if you hold a valid visa from an EU country (that's the whole EU, not only the Schengen area so also Ireland, and Cyprus, Bulgaria, Romania), Canada, Japan or the United States of America. Germany also recognizes this exemption for travelers returning from any of the above countries even if their visa is expired, but you should check with the country you're actually transiting through, because this exemption is not mentioned explicitly in the Schengen codes.