Poke holes in the eggplant with a fork several times for the steam to release as it cooks, preventing it from bursting.
Grill them on top of the burner over medium-high heat. Lower the heat if the eggplant is too large to allow the inside to cook before the skin chars completely. With a pair of tongs, turn them every few minutes until the skin is all burnt and flaky, and the flesh is soft.As an option, you can also broil the eggplant: just poke holes in it, place it on a baking sheet, and set the broiler to high. For larger eggplants, use a lower setting and broil longer, turning every few minutes until they are charred and soft inside.
Once cool enough to handle, peel the blackened skin. You can also rinse them gently under running water to remove any burnt bits on the flesh.
Mash the eggplant flesh in a bowl using a fork.
Toss in tomatoes, onions, and chilies (if using).
Add vinegar, shrimp paste, sugar, olive oil, and ground pepper to taste. Mix them well. Taste and adjust as necessary.
Notes
Eggplant: It is best to use Japanese or Chinese eggplant with its sweet and creamy flesh. The seeds are fewer and the long, slender shape allows them to cook faster. You can use Italian or (American) globe eggplant in a pinch.
Sautéed shrimp paste (Ginisang bagoong alamang): You'll need the sautéed or cooked variety for this recipe. Although not the same, fish sauce can be used instead.