Localhost refers to the computer on which a certain program is running. Like if you are running a program on your own computer then your own computer serves as a localhost server. Every computer connected to the internet has an IP address and your localhost will also have a unique IP Address.

To create a server environment in your PC, you need a software like Apache. It creates a local server so that when you type ‘localhost’ in your browser it will display your program as a web page. Apache also lets you connect your web development work to the database.

The localhost is used for development and testing purposes. Test your WordPress website by creating this local server on your computer. It also helps in speeding up the development process. 

Local server can help you connect with your WordPress web site’s database. When you download Xampp on localhost server, it helps you connect your website with the MySQL database.

Related Reading

Xampp MySQL : How to install, Configure and Use

Xampp phpMyAdmin : How to Create Database and Tables

How to install Xampp and WordPress locally