Cook slowly, stirring, till oil separates. This can take a long time and requires patience. It is also the difference between correctly cooked spices and gravy bases and not - what we would refer as to “raw” or “kaccha” masala - meaning it’s not cooked long enough / correctly.
The water from the tomatoes and onions cooked off and they reduce to a jammy consistency. There is an assumption that you used enough oil for it to separate at the edges / on top. If you didn’t, or are in doubt, and the paste starts sticking to the pan, add a tbsp of water to loosen and continue to cook.
The other way you’d know is by smell - but that’s a harder cue if the cuisine is not one you are used to cooking. Eventually, you can tell the smell of cooked masala from one that’s not quite done yet.
Keep in mind that oil separating is not synonymous with browning the onion/tomato base. You can have a bright red paste that oil separates from - and you should, unless the recipe calls for brown.
You “bhuno” the masala, and it becomes “bhuna” masala (bhun-na - the verb - is to slowly roast/cook/sauté/pan fry). “Bhunao” is a funny (wrong) anglicization into “hinglish” - I “bhunao-ed” the masala - instead of I “bhuno-ed” the masala.