In the "cluster state" which is shared with every node.
A small part of the overhead is fixed (the set of fields definitions in cluster state) and the larger part varies with the number of documents in the index. More fields = more entries in the search index data structures and RAM-based caches.
See Mapping | Elasticsearch Guide [8.11] | Elastic
Example use here