Place the lentils, onion, carrots, celery, garlic, tomato paste, vegetable broth, thyme, salt, and pepper in a large skillet. Bring to a simmer over medium heat.
Cook the lentil mixture for 25 minutes, stirring occasionally, until the lentils are tender and most of the liquid has been absorbed.
While the filling simmers, boil the potatoes in a large pot of salted water for 15 minutes until fork-tender. Drain well.
Return the potatoes to the pot. Add the milk and 2 tablespoons of the butter, then mash until smooth. Season with a pinch of salt if needed.
Preheat the oven to 400°F. Spread the lentil filling evenly in an 8-inch baking dish.
Spoon the mashed potatoes over the filling and spread to cover completely. Dot the surface with the remaining tablespoon of butter.
Bake for 20 minutes until the potato topping is lightly browned on top. Let rest 5 minutes before serving.