Well it will depend on what you are doing while this is happening. If you are doing something like gaming or watching videos, have multiple programs running, etc., this can cause it to 'try' to charge but still drain. It happens.
Now if it happens when doing almost nothing on the computer as well, then it is something else. If that is the case I would then try charging it while the laptop is off and see if it charges fine. If it still doesn't charge well, try replacing the battery. If, however, it charges just find when off, then you may want to look into replacing the charger.