Do I need a new ESTA with a new passport?
Yes. An ESTA is linked to one passport number, so a new passport needs a new application and a new fee.
Yes. An ESTA is issued for the passport number you entered on the application, and a different passport has a different number. When you get a new passport, for expiry, loss or any other reason, the old authorization does not carry over, and you need to apply again. The fee is charged again, as the CBP site sets it.
Why the passport matters
The authorization is stored against your name, date of birth and passport details. The airline checks it before you board, and CBP matches it on arrival. If the passport in your hand does not match the one in the record, the check fails and the airline may refuse to board you. 8 CFR 217.5 describes the application's data, including the passport information.
When a new application is needed
New passport. Whatever the reason, apply again with the new number.
Change of name. If your legal name changed and the passport changed with it, the ESTA is out of date.
Change of citizenship. A new nationality needs a new application, and eligibility is judged afresh.
A new passport issued mid-validity. The remaining time on the old ESTA is lost.
When an update will do
CBP's ESTA site lets you update certain information on an existing application, such as an address, your travel itinerary and some contact details. It does not allow changes to the passport number, name, date of birth or citizenship. Those require a new application.
A worked case
A traveler holds an ESTA approved in May, valid for two years, for a passport expiring in a year. In July the passport is lost and replaced. The old ESTA is tied to the lost passport, so it cannot be used with the new booklet. The traveler files a new application with the new number, pays the fee and waits for approval. If the old passport is later found, it cannot be used to travel, since it has been reported lost.
Old visas and ESTA
A traveler who holds a valid US visa in an old passport can still use it with the new passport, as the FAQ on expiring passports explains for B-2 visas, and does not need ESTA at all. ESTA is for people traveling without a visa. Do not apply for ESTA if you intend to enter on a visa. Having both can confuse the airline and the officer.
What goes wrong
Not noticing. People renew a passport and fly on the old ESTA, assuming it is still good.
Unofficial sites. Sites that look like CBP charge extra for the same application. Use esta.cbp.dhs.gov.
A typing error in the passport number. It makes the approval useless, and a corrected application is needed.
What to do
Readers in this position usually apply for the new ESTA as soon as the passport arrives, and long before the trip, since processing can take up to 72 hours.
Who this applies to
It applies to Visa Waiver Program travelers. See the FAQ on approval time.