Gather all your ingredients. Julienne the yellow onion and smash the garlic. Break down the chicken into parts.
In a large pot or Dutch oven, heat the peanut oil over medium heat. Add the onions and sauté until translucent, about 3-4 minutes. Add garlic and cook for an additional minute.
Add chicken pieces to the pot, stirring to coat in the onion and garlic mixture. Pour in soy sauce, vinegar, and water. Add bay leaves, peppercorns, and palm sugar. Stir well.
Bring to a boil, then reduce heat to low. Cover and let simmer for 30-40 minutes, or until chicken is tender. Stir occasionally.
Once chicken is cooked, remove the lid and let the sauce simmer for another 10-15 minutes to thicken. Adjust seasoning if necessary.
Serve over steamed rice, garnished with green onions or chili flakes if desired.