The general consensus is that testosterone levels start to decline around age 30, with the average being about 1.5% per year. This is one possible reason.
Along with this, consider the likely life scenarios. In your 20's, especially for professional athletes, you are in the "hungry" phase, where you are trying for that next contract, pay raise, endorsement deal, etc. As you secure these, especially in the high profile, higher impact sports (basketball, football, hockey), many players tend to ease off a bit and focus more on their families and life outside of the sport.
If you look at the lower impact sports (baseball, cycling, golf, archery), many top competitors remain so for longer times, as their body doesn't have the wear and tear on it that other sports do.
Even if you are not a professional, those same life impacts (career and families) tend to negatively affect training and athletic achievement. However, this can be fended off by adhering to a regular training schedule. For example, in triathlon, often the most competitive age segments overall are the 35-39 and 40-45 age groups.
Also somewhat disputing the age=testosterone reduction theory is a preliminary study (As far as I know it has not been peer reviewed/published yet) done in Australia with older, self identified good health participants that shows no reduction in testosterone with age for healthy, non obese individuals.