Trim the green top off the aubergines and then chop the aubergines into bite-size chunks. Warm a casserole or large pan for 2 mins over a medium heat, then add 2 tbsp oil and the aubergine. Season with a pinch of salt and stir well to coat all the aubergine in the oil. Cover the pan with a lid and fry for 10 mins, stirring occasionally, till the aubergines are tender and browned.
While the aubergines fry, peel and finely chop the onions. Trim the courgettes, halve them and slice them into half moons around 1cm thick.
Scoop the aubergines out of the pan and pop them on a plate. Add another 2 tbsp oil to the pan with the onions. Season with a pinch of salt and pepper. Turn the heat to low, put a lid on the pan and sweat the onion for 5 mins, stirring once or twice, till the onions start to soften.
While the onions sweat, halve the peppers and scoop out the seeds and white pith. Roughly chop them. Peel and grate or crush the garlic.
Stir the courgettes and peppers into the pan. Pop the lid back on and sweat for a further 5 mins to soften the veg.
While the veg sweat, pick a few leaves off the thyme sprigs (but not all, just a pinch) and set the leaves aside for later. Drain the lentils and rinse them well under cold water.
Stir the aubergines back into the pan. Stir in the crushed garlic and the thyme sprigs. Cook and stir for 1 min.
Stir the lentils into the veg. Tip in the tin of tomatoes. Add 800ml boiling water and stir in the vinegar. Put the lid back on the pan, turn the heat up and bring the ratatouille to the boil. Once it is boiling, turn the heat down and simmer for 20-25 mins till the vegetables are tender.
Fish the thyme sprigs out of the pan. Taste the ratatouille and add a pinch more salt and pepper it you think it needs it. Ladle the ratatouille into warm bowls and serve, garnished with the last of the thyme.