Place the lentils in a medium pot, cover with water, and simmer for 20 minutes until tender. Drain and set aside.
Heat the olive oil in a large skillet over medium heat. Add the onion, carrots, celery, and garlic. Cook for 8 minutes until the vegetables soften.
Stir the tomato paste and thyme into the skillet. Add the cooked lentils, vegetable broth, and frozen peas. Season with salt and pepper, then simmer for 5 minutes until the mixture thickens slightly.
While the filling simmers, boil the potatoes in a pot of salted water for 12 minutes until fork-tender. Drain, then mash with the butter and milk until smooth. Season with salt and pepper.
Spread the lentil filling into an 8x8 baking dish. Spoon the mashed potatoes over the top and smooth with a spatula. Bake at 400°F for 20 minutes until the potato topping turns lightly golden.