What is a nameserver?

A nameserver is a computer that is permanently connected to the Internet and translates domain names into IP addresses (or vice versa), enabling you to enter www.example.com instead of 194.63.248.47. In other words, it's the mechanism by which computers across the world can identify which server to go to in order to obtain the necessary website to display when you enter a domain name in your browser.

If you move your hosting from one service provider, to another, you will be able to simply change the nameservers to tell the world that your website is no longer located where it was, but has instead moved to another server.