Before you start: you will need a large, shallow casserole (or large, deep, ovenproof frying pan). Preheat your oven to 200ºC (180ºC fan/400°F/Gas 6).
Prep ingredients. Finely chop the onion. Slice the red onions into 5mm- (1 ⁄4in-) thick rounds. Peel and grate the garlic and ginger. Finely chop the dried apricots. Whisk 1 tablespoon of the oil into the tamarind paste in a small bowl, then set aside.
Start dal. Heat the remaining 2 tablespoons of oil in a large, shallow casserole over a medium heat. Add the cumin seeds, curry powder, garam masala, turmeric, and chilli powder, then cook for about 20–30 seconds, until foaming and fragrant. Add the chopped onion and a generous pinch of salt and cook for 7–8 minutes, until soft and beginning to caramelize, adding a little water if the onion starts to catch. Add the garlic and ginger and cook for a minute or two until fragrant.
Add lentils. Rinse the lentils in a sieve under cold running water until the water runs clear, then drain well. Add the lentils, apricot jam, chopped apricots, canned tomatoes, coconut milk, stock, and nutritional yeast. Season with salt, then stir until combined. Bring to a gentle simmer, then reduce the heat to low and heat through briefly.
Bake. Top the lentil mixture with an even layer of the sliced red onions, then spoon over the tamarind mixture to glaze. Season with salt and bake in the preheated oven for 40 minutes, until the lentils are tender and the onions are caramelized and jammy. (For extra-caramelized onions, finish cooking the dish under the grill.)
Serve. Carefully remove the dish from the oven (or grill). Chop some extra dried apricots and scatter them over the top with a few sliced green chillies and coriander leaves. Serve with basmati rice by the side.
Store. Leave the dal to cool and store in the fridge for up to 3 days or freeze for up to 3 months.