Preheat oven to 375°F (190°C).
Heat olive oil in a skillet over medium heat. Sauté onions, garlic, and carrots until softened.
Add cooked lentils, tomato paste, thyme, salt, and pepper. Stir in vegetable broth and cook until thickened.
Mix in frozen peas and remove from heat.
Transfer the filling to a baking dish and spread evenly. Top with mashed potatoes, smoothing the surface with a spatula.
Bake for 20-25 minutes or until the top is golden and bubbly.
Let cool for a few minutes before serving.