Question: What happens internally when ESP8266 goes to deep sleep mode. Is there any official documentation explaining that?

Answer: 
You can see this document <https://www.losant.com/blog/making-the-esp8266-low-powered-with-deep-sleep>

In summary, ESP8266 supports 3 sleep modes:

1. Modem-sleep
2. Light-sleep
3. Deep-sleep

[![enter image description here](https://i.stack.imgur.com/ejx8u.jpg)](https://i.stack.imgur.com/ejx8u.jpg)

### Modem-sleep Mode

Modem-sleep mode is enabled only when ESP8266 connects to a router in station mode, via DTIM beacom mechanism. Within this mode, ESP8266 would wake up periodically, automatically, to handle arriving Beacon.

CPU and system are still on. Hence program that does not require constant network access could still run.

### Light-sleep Mode

System clock is off and CPU is suspended. No program could run.
ESP8266 could be woken up via external GPIO level triggers.

### Deep-sleep Mode

System clock and CPU are off.
ESP8266 could be woken up via  

a) a low-level pulse generated on the EXT-RSTB pin via an external IO.  

b) timer which is managed by the RTC
Have a look [here](https://en.wikipedia.org/wiki/Clock_gating) as well, it is about clock gating and what actually happens when a micro goes to sleep. In short, to greatly reduce power consumption, internal peripherals (such as its ADC and so) are disabled.
Also, embedded.com has a neat explanation of [what happens under the hood](https://www.embedded.com/design/power-optimization/4237635/Understanding-MCU-sleep-modes-and-energy-savings).