ESTA authorisation is not only required for actual stays in the United States. In fact, even if your travel destination is another country, but your flight has a stopover or transit through a US airport, you will need a valid residence permit such as an ESTA to be able to take that itinerary.