It's extremely relevant to know that common electronic devices even turned off or physically unplugged store enough energy to produce critical consequences. A bit of naivety and a screwdriver could drive to electrocution so please remember it with priority!
However, there are techniques for discharging those parts with a very similar behavior than conventional batteries. A capacitor, as it name suggests, stores a charge and this is due to an electrostatic field inside plates.
Some capacitors are capable of storing the energy during large periods of time, up to months or years. In a usual electronic device at home not so much time but hours or perhaps a specific model could reach days or who knows.
When the capacitor doesn't receive more direct current, the stored charge can go to another place in the circuit. This property of the electrostatic field in terms of energy storage permits to design the considerably high efficient (90% or near) power supplies, or converting the voltage toward more or less without losing too much energy in the process.
A bleeding resistor simply waits until the capacitor wants to release the stored energy, providing a path to ground. In dependance of the resistance, the capacitor will lose all the energy before or after.
At least optimistically because if the bleeder resistor fails there's a chance of greater stress to the capacitor, deteriorating its specifications until perhaps a dramatic explosion with fume and a noxious smell.
There's also another important fact talking about capacitors, one that causes hospitalizations each year. Dielectric absorption is when the capacitor tends to self-acquire charge after being completely discharged. Another key factor to carefully remember, when the capacitor was charged during large periods of time.
Never forget protection working with electricity!