My MacBook Air sometimes doesn't charge when the charger is plugged in
In my case, the problem was the temperature of the charger. Since it's currently winter in the southern hemisphere, removing the MacBook from charge causes the charger to cool down (since it apparently draws very little mains power when there is no load on the MacBook side). At some point when it is cool enough, it will refuse to supply power when the MacBook is plugged in again.

The workaround is to warm up the charger (for example, by sitting on it) for a few minutes until the charge light comes on. Then the current running through the charger is enough to keep it warm, and it continues charging.

Update: A year later, after returning from being away for six weeks, my charger refused to work again even after sitting on it. Apple was happy to replace it under AppleCare.