Heat the vegetable oil in a pan over medium heat. Add the chopped onion and minced garlic, and sauté until translucent and aromatic.
Add the chopped chilies and tomatoes to the pan. Cook for a few minutes until the tomatoes start to break down and release their juices.
Stir in the ngapi (fermented shrimp paste) or fish sauce substitute. Cook for a couple of minutes, allowing the flavors to meld together. If using shrimp paste or fermented fish sauce, add it at this stage.
Add palm sugar and fish sauce to the mixture. Stir well to combine, and let it cook for a few minutes.
Pour in the water or chicken broth. Bring to a simmer and cook for about 10 minutes, allowing the flavors to develop and the sauce to thicken.
Taste and adjust seasoning if needed. Serve hot, garnished with fresh cilantro, sliced green chilies, and lime wedges on the side.
Enjoy your meal!