Preheat oven to 450 degrees. Wrap garlic loosely in foil. Put garlic and eggplants on a rimmed baking sheet. Roast until eggplants and garlic are soft and eggplant skins begin to blister and blacken, about 45 minutes. Remove garlic from oven.
Raise oven temperature to broil, and broil eggplants until skins are charred, about 3 minutes.Transfer to wire racks, and let cool completely.
Heat oil in a small nonstick skillet over medium-low heat until hot but not smoking. Add onion slices; cook, stirring occasionally, until soft and golden, about 8 minutes. Set aside.
Whisk together chopped onion, yogurt, and lemon juice in a large bowl. Squeeze roasted-garlic pulp into yogurt mixture, and stir well.
Cut each eggplant in half lengthwise. Scrape flesh into a large fine sieve set over a large bowl; let drain 15 minutes. Discard liquid. Stir eggplant and the salt into yogurt mixture; season with pepper. Top with reserved cooked onion.