What nameservers do
Nameservers are the servers that hold the DNS records of a domain. When someone looks up your website or sends you mail, their resolver first finds out which nameservers are responsible for your domain and then asks one of them. Whoever runs those nameservers decides what every other record says, which is why the NS set is the first thing to check when DNS behaves unexpectedly.
The NS records usually reveal the DNS provider at a glance: a registrar, a CDN such as Cloudflare, a cloud provider or servers the owner runs.