Warm the canola oil in a medium pot over medium-high heat. When shimmering, add the cumin seeds and fennel seeds-they should sizzle upon contact. If they don't, turn the heat up a little. Cook about 30 seconds.
Add the onions and cook, stirring often, until the onions turn golden, about 10 minutes.
Now add the garam masala and cayenne pepper; cook, stirring vigorously for about 30 seconds.
Add the apples, ginger, sugar, apple cider vinegar, 2 teaspoons of salt and a generous amount of freshly ground pepper; stir and cook until the sugar melts. Keep cooking, stirring often, until the sugar thickens and caramelizes, and the apples soften, about 15 minutes.
Taste for seasonings and serve.
Combine the cinnamon sticks, cloves, green cardamom seeds, black cardamom seeds, if using, into a spice grinder or coffee grinder and grind until fine. Store the spice mix in an airtight container away from direct sunlight.