Whole spices and ground spices don't go into the pan at the same time, and here's why. Whole spices like mustard seeds and cumin seeds go into hot oil first. They pop and sizzle, and that's when the flavour comes out into the oil. Ground spices are fine like powder, so if they go straight into hot oil they burn really quickly, and burnt spices taste bitter. So they go in later, after the onions, because the onions give off water and that stops the spices burning. Whole first, ground later, it's a small change but it makes a big difference. Did you know this, or is it new to you?