Name servers are servers that provide responses to queries from clients, like browsers and email clients. Their responses allow the client to connect with its desired resource.
Without name servers, users would have to enter the IP address of a website to see it. Name servers allow the user to enter the domain name and see the website for it.
How Name Servers Work
When a person enters your website address in a browser, the browser has to find the address of the file for your website so it can present it to the person. But your domain doesn't provide the address. Instead it tells the browser which name server to check for the address. The browser proceeds to the name server, gets the "A" record for your domain, then requests your website's file. Your host responds to the request by returning the requested file.
Here's an example
A user enters "www.example.com" into Firefox. Firefox looks up example.com and learns that the name server for example.com is ns1.example2.com. It visits that name server, pulls the "A record" which responds with the IP address of www.example.com: 123.456.789. Firefox then makes a request to 123.456.789 for the file. The host returns the file for the website. Firefox displays the website to the user.