This type of record is used to share the list of authoritative DNS servers for a given domain. Server names (i.e. their domain names) are listed, not IP addresses. If a device wants to connect to the authoritative DNS server of a domain, it first finds out all NS-type records for the searched domain on the higher-level DNS server, selects one of them and finds out its IP address. Only then can a communication connection be established via the DNS protocol.
The same records are also stored directly in the records of the domain. To illustrate, this is the result of a request on the domain “cuni.cz” if you ask the server “ns.tld.cz”.
cuni.cz. 18000 IN NS ns.ces.net. cuni.cz. 18000 IN NS golias.ruk.cuni.cz.
We can see that in response we have received two NS records, which give us the desired result. We will get the same answer, for example, for the query “mff.cuni.cz”, because the server does not know the whole answer, but will refer us to other DNS servers that should know it. It is important that we get the same result again if we ask one of its authoritative DNS servers directly for the “cuni.cz” domain. This means that each domain has NS records stored in its records on itself.