The SoftwareSerial is used to communicate with the esp8266 from other MCU. The ESP8266WiFi library is for Arduino sketch running in esp8266.
The esp8266 can be used with firmware as 'network adapter' for your sketch running for example in Arduino Uno. MCU in Uno has only one hardware Serial which is used to communicate with the computer over USB (to upload and use Serial Monitor). To communicate with the esp8266 usually a second Serial interface is created with SoftwareSerial.
But esp8266 can be used as Arduino board with "esp8266 Arduino core". This 'core' contains Arduino libraries to access the WiFi functions of the esp8266 from a sketch running in esp8266.