Peel and dice the onion; set aside in a mixing bowl. Using tongs, roast the eggplant directly on the burner of a gas stove over medium heat, turning often, until skin is completely blackened and the flesh is soft, about 10 minutes. Alternatively, prick a few holes in the eggplant (to vent steam) and roast it on a rimmed baking sheet in a 500 F oven for about 20 minutes.
When eggplant is charred all over, set it aside until it is cool enough to handle. Then pull off skin with your fingers or a knife (discard the skin); finely chop the eggplant with a knife or pass it through a ricer. Set aside. Finely chop green chilies, including their seeds, and set aside.
Add oil to a skillet or kadai over medium-high heat, followed by the onion. Cook until edges are brown, but there is still a bit of texture, about 15 minutes. Add ginger and stir; if the onion mixture is sticking to the pan, add a little water to deglaze it. Add garlic and stir; then add coriander, cumin, and cayenne, deglazing as needed with more water to prevent the spices from burning.
Add eggplant to the pan and continue cooking, stirring well to combine thoroughly. Add salt to taste, ensuring that all the flavors are balanced. Add tomatoes and stir to combine; then add the desired amount of green chili, follow by cilantro. Season again with salt. Stir in garam masala, a squeeze of lemon juice, stir and serve.