Carrots along with celery and onion are part of the soffrito that helps season the sauce. The natural sweetness of the carrots helps build the complex flavor profile associated with a bolognese sauce.