Everything about this classic dish works for me – its innate frugality, everyday ingredients and lack of pretension. What is probably the world's best-known soup has much to offer if we get it right.

Elizabeth David was unimpressed with the "sodden bread, strings of cheese and half-cooked onion floating about" in the typical French onion soup. I disagree. Everything about this classic dish works for me – its innate frugality, everyday ingredients and lack of pretension. What is probably the world's best-known soup has much to offer if we get it right.

The recipe

Serves 4-6

700g onions

40g butter

2 tbsp flour

1.75 litres beef stock

1 glass of white wine

Baguette to toast

Gruyère or Emmenthal

Peel and thinly slice 700g onions, then leave them to soften in 40g butter and a small glug of olive oil over a low to medium heat. Stir them regularly. They are ready when they are soft, sticky, sweet and deep gold in colour. Some add a pinch of sugar at this point to help the onions caramelise. Stir in a couple of tablespoons of flour, cook for 3 or 4 minutes, then pour in 1.75 litres of boiling beef stock and a glass of white wine. Partially cover with a lid and leave to simmer for a good 45 minutes.

Season, ladle into deep, heatproof bowls, place several thin slices of toasted baguette on to each, then cover with thinly sliced Gruyère or Emmenthal. Bake in a hot oven for 20 minutes or grill until the bread is toasted and the cheese has melted but not browned.

The magic

The trick to getting this soup right is that the onions caramelise – they must cook for at least 35-40 minutes over a low to moderate heat. Only when the onions are soft enough to crush easily between finger and thumb can you add the flour and stock.

The twist

Contemporary versions can involve roasting the onions in the oven to give a more concentrated sweetness. Red onions produce the sweetest version of all, so you might like to add thyme and bay as a balance. Parmesan in place of Gruyère produces a less fatty but just as tasty crust.

Email Nigel at nigel.slater@observer.co.uk or visit theguardian.com/profile/nigelslater for all his recipes in one place