Why are people kept awake during brain surgery?
It might seem like being awake during brain surgery would be really painful. But it's not. The doctors numb the person's scalp and skull. And the brain itself can't feel anything!
People are kept awake during brain surgery so that the doctors can figure out what different parts of the brain do in order to avoid damaging a really important part. For example, say a patient had a brain tumor and he was having surgery to get it removed. The doctors would want to be extremely careful not to damage a part of the brain that was responsible for language, because then the patient might not be able to talk or understand what other people were saying. The doctors would know about where the language area of the brain was located, because everyone's brain is organized in basically the same way. But if the tumor was very close to the language area, they would have to find the exact boundary. They couldn't just use a textbook, because there's a tiny bit of variation between individual people in how different brain areas are laid out. They'd have to find the patient's own personal language area boundary. Here is a picture of about where each person's language area is located.
One way to do this is to have the patient talk to the doctors while they probe his brain in different areas. If probing in one spot causes the patient to stop talking, or to speak incoherently, then that area is essential to language. One way the doctors could probe different areas would be to apply a small amount of electricity to each area. Being awake during brain surgery is probably scary... but it's the best thing to make sure no really important areas are damaged.