When would power of attorney be needed?

a.when someone dies unexpectedly
b.when a person is unable to manage their affairs
c.when someone dies but there is no will and the estate must be managed
d.when a living will is not in place and beneficiaries must be named