The first is funding. States are required to provide a free and appropriate public education.
That doesn't mean an education that's equal across the entire state. Just up to what's required. Over time, that minimum level's increased and increased and increased. Parents find ways around requirements to equalize funding.
The second isn't availability, it's participation and preparedness. A high school in my area was built and fully equipped with AP labs for science. Another older school had AP labs and a good set of AP courses.
The new school barely ever offered any AP classes. Students either didn't sign up, or the wash-out rate was so high that they stopped signing up. AP courses have standards set outside of the district.
The existing school saw its surrounding population change. It went from solidly middle-class to working class. The AP classrooms were used for storage, the AP storerooms converted to storage for other things. $10s of thousands of dollars of equipment was stacked, fell over, restacked, and then used to keep somebody's seedlings for a level biology class at window height. The seedlings leaked. The equipment was trashed. Same with thousands of dollars' worth of slides and preserved specimens. Somebody needed the slides they were mounted on, so expensive specimens were scraped off to save spending $20 on cheap plain glass slides. (Actually, it turned out nobody bothered to order them--they had the money, but not the foresight.) It wasn't like the AP teachers weren't still there. One was my student-teacher mentor. Was bumped from teaching a full day day of AP and pre-AP biology down to level science because there weren't enough students signed up for either class.