Answer
The potential energy of a compressed spring and the potential energy of a charged object both depend on the work done on them.
Work Step by Step
Work done on them transfers energy into the system, storing it there.
This is discussed on page 421.