Cheese, specifically sharp cheddar, has been served with apple pie in the U.S. as early as the 1800s. But the combination was likely born in England in the 17th century; a tradition of using dairy-based sauces in pies evolved into an affinity for topping pie with cheese instead.
The context missing here is that apples weren't nearly so sweet prior to breeding in the late 1800's. Colonial-era apple pie was closer to what we might think of as a mashed potato pie, it was a savory dish. The "American as apple pie" thing comes from the late 1700's/early 1800's when apple pie was a regular weeknight meal for working-class Americans, it wasn't seen as a dessert until much later.
This is also why potatoes are called "pommes de terre" in French (apples of the earth).