Adding to the other commenters’ fantastic explanations, some minor tips:
Spices: basil, oregano, a quarter handful of bay leaves, thyme. Cover the whole pot with a generous layer of each, then stir in. If it gets too acidic, add a tiny dash of sugar. Beyond that is chef’s creativity, make it your own.
Time: A decent sauce is 3ish hours. Great sauces are all-day sauces. The best sauces are all-day sauces that are re-simmered for half an hour or so the next day.
Extra: Homemade sauce stores really well. Toss leftovers in a container in the freezer. Will last you a couple months at least.