Why do you have to salt eggplant before cooking?

why is it necessary to salt eggplant to drain the moisture before cooking it?
4 answers 4