Depth of flavour can come from seasoning and using herbs and spices, often even just adding salt and pepper to something bland improves it considerably (as long as you do it bit by bit so you don't over salt it).
It also comes from browning meat to caramelise it and from things like cooking the spices through, and from using meat juices, etc.
When I make gravy, I use the juices from whatever meat I've roasted and separate most of the fat out, which I'll keep for roasting veg, etc.
The juices are usually in 2 forms, jelly like and a more liquid form with bits in that are stuck to the tray, which is often brown coloured.
I'll use both to form the basis of a gravy, alongside a few dessert spoons of the fat from the meat, a chopped carrot, bit of chopped, diced onion, etc. It all goes into a pan to be thickened as needed with cornflour or flour so you have a paste/roux, I then slowly add around 300ml hot water, stirring as I go. I usually use the water I've cooked my veg in to add more flavour, but you can use water made with a veg or meat stock cube. I then let it simmer til thickened and season to taste.
I'll often put a few bits of chopped veg (eg, carrot, onion, leek) under the meat so it cooks with it and that all gets added to the gravy as it all helps with flavour.
If not needed at the time of the roast being cooked, I will often freeze all the juices to use as stock at a later date.
When using tomato puree in a sauce I cook it out for 30-60secs so that it has a better, more rounded flavour in the final dish...by that I mean I add it to the pan with the veg or meat (no liquid) and stir it and cook it for 30-60 secs before adding the liquids.
This is the same as I do with any spices or spice paste. It gives a better, more rounded flavour and takes the harshness away that you get if something isn't cooked through properly.
Slow cooking also helps develop flavour.