Place the ham, bay leaves, and 3 quarts water in a large stock pot or dutch oven. Cover and bring to a boil over medium heat. Reduce the heat to low and simmer until meat is tender and pulls away from the bone, 2 to 2 1/2 hours. Remove the ham meat and bone from pot. When ham is cool enough to handle, shred the meat into bite sized pieces and set aside. Discard rind, fat, and bone.
Add split peas and thyme to ham stock. Bring back to a boil, reduce the heat, and simmer, uncovered, until peas are tender but bot dissolved, about 45 minutes.
While ham is simmering, heat oil in a large skillet over high heat until simmering. Add the onions, carrots, and celery and saute, stirring frequently, until most liquid evaporates and the vegetables begin to brown, 5 to 6 minutes. Reduce the heat to medium-low and add the butter, garlic, and sugar. Cook the vegetables, stirring frequently, until deeply browned, 30 to 35 minutes; set aside.
Add the sauteed vegetables, potatoes, and shredded ham to the pot with the split peas. Simmer until the potatoes are tender and the peas dissolve ad thicken soup to the consistency of light cream, about 20 minutes more. Season with ground pepper to taste. (The soup can be refrigerated in an airtight container for 2 days. Warm the soup over low heat until hot.) Ladle the soup into bowls, sprinkle with red onion, if using, and serve, passing balsamic vinegar separately.