Eggplants differ in bitterness. You can cook some of them and never notice a problem. But other exemplars are quite bitter, and can overwhelm a dish. That's why it is a good idea to preemptively do something to remove their bitterness.
I have read dozens of suggestions how to do it. Some are OK, others are downright terrible. Have you tried soaking eggplant in water with lemon juice? An eggplant being basically a sponge, you end up with pieces bloated to three times their original size, dripping water into whatever dish you try to use them in. Also, they stay rather bitter.
The logic behind the salt is that it will suck out the bitter juice of the eggplant through osmosis. You can then remove the mushy salt and use the eggplant pieces. You can certainly use it if you want, but it isn't the best method. First, osmosis does occur when you salt food, but nowhere near the rates claimed. You don't end up with a dessicated steak if you salt it 10 minutes before frying, and if you salt a slice of eggplant, you have to make thin slices (doesn't work for ratatouile 2-cm-cubes), give it some help (press the slices with a weight so the juice will be pressed out) and wait a long time. Even then, the results can be inconsistent.
The good news is that one of the few veggie-themed Food labs posts is dedicated to the problem of disembittering eggplant. The tests seem to be as rigorous as usuall, and the best practice recommendation is to not salt the eggplant, but bake it.
Microwave is the best method, as it dehydrates well and does so quickly. If you don't have a microwave, the second-best method is the oven.
- Slice the eggplant, aiming for even thickness
- Put absorbing paper towels on a baking sheet (oven) or a wide plate (microwave)
- Arrange the eggplant slices in a single layer on the towels
- Cover them with another layer of towels
- Optional: stack another layer of slices and towels to get all the eggplant ready at one go
- Anchor the towels with some weight. (I use all-metal serving knives laid across the slices; another plate on top would work in the microwave).
- Microwave for 3 min or roast at 175°C for 30 min
- Use your eggplant as intended
Obviously, this isn't good for all applications, because it dehydrates the eggplant. For example, I don't think you can make a good imam bayildi with the dry roasted eggplant (but then, maybe it will be OK, I've never tried). But for the typical uses in Western cuisine, it should go fine.
The original article is also highly recommended reading, as any of Kenji's stuff.