Half-fill a large bowl with water and ice cubes and set it beside the stove.
Combine sugar and water in a heavy 3-quart saucepan. Bring to a boil over medium-high heat, stirring occasionally to dissolve sugar. Once it starts boiling, cook without stirring until syrup turns amber, 5 to 10 minutes. Immediately set saucepan in ice water for about 30 seconds.
Add soy sauce, star anise and garlic to cooled caramel. Return pan to medium-high heat and bring to a simmer, stirring occasionally. Reduce heat to low and simmer for 10 minutes. Remove from heat and let cool completely. Discard garlic. Transfer to a jar (sterilized if keeping longer than 1 week) and let mellow overnight in the refrigerator before using.
Make Ahead Tip: Cover and refrigerate for up to 2 weeks or freeze for up to 6 months.
People with celiac disease or gluten-sensitivity should use soy sauces that are labeled "gluten-free," as soy sauce may contain wheat or other gluten-containing sweeteners and flavors.