Draining is an effect that weapons with the draining brand, certain Necromancy spells, and certain monsters can inflict with their attacks. It withers its victim, reducing their general effectiveness, but its exact effect varies depending on the target.
When used against susceptible monsters, it inflicts the Drained status effect, causing the creature to function as though it had fewer HD than it actually does. This reduces the strength of their attacks and spells, as well as reducing their magic resistance. This status effect can be stacked through multiple hits, but will wear off over time.
Draining attacks directed against the player will inflict a somewhat different version of the Drained status effect. You are instead weakened by having all of your skills reduced by an amount directly proportional to the amount of draining you've sustained. At low levels of draining, this might amount to a penalty of half a skill level, while extreme cases can seriously reduce your ability to function.
These drained skill levels will be restored as you gain experience, eventually being cured entirely. The worse the drain, the longer it'll take to work off the effect, especially once you realize that your attacks may now be weaker and slower, and some of your best spells may no longer be available. You can reduce the chance of being drained in the first place, as well as the severity of the draining, by having negative energy resistance: damage and draining are reduced by 50/75/100%, depending on how many ranks of resistance you have.
Even if you are immune to draining due to having rN+++, some sources of draining can bypass this, notably the draining cost of some of Ru's abilities.
Priot to 0.16, negative resistance lowered draining and negative damage by 33/66/100% as your resistance increased.
Prior to 0.13, getting drained would damage your character's experience, potentially forcing you down a level. This was permanent, but you could simply gain more experience to make up for it. This had no impact on your skills.