Onion and tomato appear together at the start of an enormous number of Indian dishes, which suggests they are one component. They are not, and cooking them as one is a common source of disappointment.
Onion supplies sweetness and body
Slow cooking breaks down onion's structure and converts its sugars, producing sweetness and a soft mass that gives a gravy its thickness.
This takes real time. The transition from translucent to golden to deep brown represents different flavors, and each stage suits different dishes.
Rushing it leaves a raw pungency that persists through everything added later, and no amount of simmering afterward removes it.
Tomato supplies acid and moisture
Tomato brings tartness that cuts through fat and balances the onion's sweetness, plus water and pectin that help the sauce hold together.
Its acidity also slows the softening of other vegetables, which is why cooks add it after ingredients that need to break down.
Tomato needs cooking too, until it loses its raw edge and the mixture tightens, though the time required is much shorter than the onion's.
Adding them together undermines both
Tomato releases water, and onion cannot brown while water is present, since browning requires the pan surface to exceed boiling temperature.
So a pan with both in it stews rather than browns, and the onion arrives at the end of cooking pale and sweetly raw.
Cooking the onion first, then adding tomato, is the whole reason recipes list them as separate steps with their own cues.
American produce changes the ratios
Supermarket tomatoes in the US are frequently low in acid and high in water, which pushes the balance toward bland and watery.
Canned crushed tomatoes are more consistent and often more acidic, and they are a legitimate everyday choice rather than a compromise.
Yellow onions are the closest widely available match to what these recipes assume; sweet varieties such as Vidalia push a gravy noticeably sugary.
What each one can be replaced by
Where onion is omitted, cooks build body with cashew paste, coconut or thickened dairy, and those dishes have a recognizably different character.
Where tomato is omitted, acidity comes from yogurt, tamarind, kokum or dried mango powder, each contributing a distinct kind of sourness.
Recognizing which job is being filled makes substitution rational, and it explains why swapping tomato for lemon juice rarely works as a simple exchange.