Start by chopping the onion finely, mincing the garlic, and dicing the jalapeno pepper (remove the seeds for less heat or keep them for an extra kick). Peel, core, and grate the apple.
In a medium saucepan, heat 2 tablespoons of olive oil over medium heat. Add the chopped onion and sauté until softened and translucent, about 5 minutes. Stir in the minced garlic and diced jalapeno pepper and cook for another minute.
Add the grated apple to the saucepan and sauté for 2 minutes. Pour in the ketchup, apple cider vinegar, apple juice (or unsweetened applesauce), and molasses. Mix well.
Stir in the brown sugar, smoked paprika, ground mustard, cayenne pepper (if using), salt, and freshly ground black pepper. Adjust the seasoning to your taste.
Reduce the heat to low and simmer the sauce for 20-25 minutes, stirring occasionally, until it thickens to your desired consistency.
For a smoother texture, blend the sauce using an immersion blender or transfer it to a regular blender and puree until smooth.
Allow the sauce to cool before transferring it to a clean jar or airtight container.