I saw this technique mentioned in this Youtube short where the chef makes a burnt onion shrimp curry. In my experience burning stuff is not a good move for making it taste good. Why did it apparently work well here?
I wouldn't call those onions actually "burned", which would be all-black. They're charred, just like you would get if you cooked them on a grill.
Charred onions have a very sophisticated flavor combination. The burned edges are bitter and earthy, and the unburned parts are sweet (just like any very-well-cooked onion is). So out of the five primary flavors, charred onions are adding two of them (bitter and sweet) plus a tiny bit of charcoal flavor. If you add sour (tamarind), umami (shrimp), and presumably some salt (not shown), plus secondary flavors through hot peppers and coconut cream, then you have a dish with a complete set of flavors: bitter, sweet, sour, salty, umami, hot, and fatty. That balance of opposing flavors makes it taste good, and the charcoal flavor from the charred onions makes the shrimp taste "grilled" even though they're not.
Heck, at this point I want to make that curry.