If you don't have (or can't spare) a cast-iron skillet, sauté the apples and onions in any heavy skillet and transfer to a buttered 8x8" glass dish for baking.
Ingredients
3/4 cup plus 2 tablespoons unsalted butter
1 medium onion, thinly sliced
1 teaspoon kosher salt plus more
Freshly ground black pepper
2 medium red- or pink-skinned apples (such as Pink Lady), thinly sliced
5 tablespoons sugar, divided
3 teaspoons fresh thyme leaves, divided
1 1/2 cups cornmeal
1 cup all-purpose flour
1 tablespoon baking powder
2 large eggs
1 1/2 cups buttermilk
Directions
Preheat oven to 400°F. Melt butter in an 8" cast-iron skillet over medium-high heat. Pour all but 2 tablespoons butter into a small bowl; set aside.
Add onion to butter in skillet; season with salt and pepper, and cook, stirring occasionally, until onion is softened and beginning to brown, about 4 minutes. Add apples, 2 tablespoons sugar, and 2 teaspoons thyme and cook, stirring often, until apples are softened, about 4 minutes. Transfer onion mixture to a medium bowl and reserve skillet.
Whisk cornmeal, flour, baking powder, 1 teaspoon salt, and remaining 3 tablespoonss sugar in a large bowl. Gradually whisk in eggs, buttermilk, and 3/4 cup reserved melted butter until smooth (no lumps should remain). Fold in half of onion mixture and scrape batter into reserved skillet. Top with remaining onion mixture and remaining 1 teaspoon thyme.
Bake cornbread until golden brown and a tester inserted into the center comes out clean, 30–40 minutes. Let cool slightly before serving.
DO AHEAD: Cornbread can be made 6 hours ahead. Reheat before serving, if desired.