How to Make It
Combine onions, carrot, and 3 cloves garlic in a food processor; pulse until finely chopped.
Heat ¼ cup oil in a large pot over medium-high. Add onion mixture and cook, stirring often, until softened, about 5 minutes. Add spices and ½ teaspoon salt. Cook, stirring, for 1 minute. Add lentils and stir to coat. Add broth, pepper, and remaining 1 teaspoon salt. Bring to a simmer and cook, partially covered, stirring occasionally, until lentils are tender, 20 to 40 minutes, depending on type of lentils (red will cook fastest; brown and green could take 10 to 20 minutes more). Stir in lemon juice.
Meanwhile, combine walnuts with remaining 2 cloves garlic and ¼ cup oil in a small skillet over medium-low. Cook, stirring, until walnuts are toasted and garlic is fragrant, about 2 minutes. Stir in cilantro and lemon zest. Serve soup topped with walnut mixture.