Heat the olive oil in a large pot over medium heat. Add the onion and fennel, and season with salt and pepper. Cook, stirring occasionally, until caramelized (this will take you at least 30 minutes; add a splash of water or broth every now and then for a better and quicker browning).
Stir in the cumin and chili powder and cook for another minute or two, just until the spices bloom in the fat and become fragrant. Using a slotted spoon or fork, remove about half of the caramelized onions and fennel and set them aside for topping.
Add the squash and garlic to the pot and season again with salt and pepper. Cook, stirring occasionally, until the garlic is tender and the squash begins to break down into a very coarse mash, about 15–20 minutes.
Add the lentils along with the broth and season with salt and pepper. Bring to a gentle simmer and cook until the lentils are tender and the squash has melted into the broth, about 30–35 minutes. The soup should be creamy and thick, similar to split pea soup — not fully smooth, but with small pieces of squash throughout. If it seems too thin, continue simmering until the texture suits you.
To serve, stir in the white wine vinegar and adjust seasoning with more salt and pepper as needed; the soup should have enough acidity to balance the sweetness of the squash. Ladle into bowls and top with the reserved onions, yogurt or sour cream, herbs, a drizzle of olive oil, and a final grind of black pepper.