Section 508 is part of the US Rehabilitation Act, which requires federal agencies to make electronic and information technology accessible to people with disabilities. WCAG 2.1 AA, on the other hand, is a set of guidelines that define how to make web content more accessible, with "AA" being a specific level of compliance.