Formally, it's a system-on-a-chip (SOC) that has a TCP/IP stack built in. It's sort taking a wifi controller and squeezing out the extra pins and processing power as a pretty capable Arduino-compatible microcontroller. The ESP8266 can manage all wifi networking, or pass that onto another processor to do. As it is, it come preloaded with an AT command set, so you can use any microcontroller to set all necessary communication parameters through simple serial connections.
To manage this wifi magic, the ESP8266 uses an 80MHz 32-bit processor, with power to spare to drive other functions besides Wifi. It offers 16 GPIO pins, 64kB instruction RAM and 96kB of data RAM besides the 4MB external flash. This means there's little more you have to add to it to have the ESP8266 monitor sensors and toggle I/O lines (using 3.3V logic levels).
Note: The ESP8266 Module is not capable of 5-3V logic shifting and will require an external Logic Level Converter. Please do not power it directly from your 5V development board.
Huge amount of information on: http://www.esp8266.com/ community forum!
NodeMCU (Lua for ESP8266) webpage: http://nodemcu.com/index_en.html#fr_5475f7667976d8501100000f with examples and documentation on the Lua framework
Arduino IDE support for ESP8266: https://github.com/esp8266/Arduino