Some things absorb energy, and some things emit energy.
Batteries and other voltage sources can donate energy to the rest of the circuit, but most components, like the resistor in your examples, cannot.
When current flows through a device in the direction where it enters the high potential terminal, flows through the device to exit at the low potential end, then the device is absorbing, or receiving energy. LEDs and resistors and most things, really, do this; they absorb energy and convert it to some other form such as light or heat or motion.
You pointed out that the voltage source or battery does the exact opposite, with current flowing through the device from its low potential end to high. This makes sense, because those devices are donating energy to the the other components in the circuit. This must be true, because of the law of conservation of energy. If light and heat and kinetic energy is leaving a circuit (because of resistors and LEDs and motors and wotnot), something must be providing that energy, the battery in this case.
More interesting is the fact that if somehow you managed to get current in a battery to flow through it in the direction high potential to low (just like a resistor), then the battery must be receiving energy, not donating. In fact this is exactly what we do to charge a battery. Unlike a resistor, a battery is designed to store that energy chemically (instead of waste it as heat) for recovery later.
By contrast it's impossible to get current to flow in a resistor in any other direction than high to low potential; the voltage across the resistor will always be highest where current enters, that's Ohm's law. It's because resistors cannot possibly do anything other than convert electrical energy to heat, never the other way around. Resistors can't ever donate energy to other parts of the circuit, they can only receive energy and convert it to heat (also see my note about this at the end).
A capacitor, on the other hand, is quite capable of both receiving and donating energy. Current flowing through it will always cause potential at the terminal where current enters to rise with respect to the terminal where current leaves. If this results in the potential difference increasing, then the capacitor is charging, and storing more and more energy. If the voltage across the capacitor is reducing, then it's discharging and donating energy.
A capacitor's stored energy can be recovered by allowing its potential difference to push current through some external energy recipient. In such a case, with the capacitor now discharging, donating energy, that current must be in the direction in which it exits via the capacitor's higher potential terminal, just like a battery.
Note: Actually, it is possible for a resistor to donate energy to other parts of a circuit, in the form of noise current. Heat in a resistor causes a small amount of AC current to flow, but that's another topic altogether.