In computer networking localhost literally means “this computer”. When you type a URL into your browser, you are essentially connecting to a “host” computer somewhere else in the world. This computer serves you the web page that you requested. If you type “localhost” into your browser, however, then your browser will know that you want to connect to the computer you are currently using. If your computer is running web server software like Apache, then your browser will be served a web page by your own computer, which is otherwise known as the localhost. Every computer connected to the internet has an IP address and your localhost has one too. Typically the IP address is 127.0.0.1.
Localhost is often used for testing and development. When a developer installs WAMP, LAMP, or MAMP software stack on their personal computer, then they will typically type “localhost” into their browser in order to pull up their WordPress web site. Local server environments can speed up the development time. It is also great for learning purposes.