First the resistor and Zener limits the voltage to 3.3 or 5 Volts.
Now that we have a known max voltage,
a voltage divider takes it down further to approximately 1.02 V so that the sensitive ADC pin is reasonably safe.
The voltage divider can probably be made with much lower resistances and still keep the max current within the tolerances of the ADC pin on the ESP8266 IC.
Potential improvements:
Reverse voltage protection (not sure what the max neg' voltage for the ADC pin is),
"over-voltage" indicator LED in line with Zener (LED Vf + Zener Vbreakdown = max V, beware of current spikes).