Slowly cooking the onions will caramelize them, which brings out the sweetness and gives them a brown color.