What's a tag?

A tag is a piece of information stored inside a music file. Tags are often referred to as metadata, or "data about data". Tags provide information about the audio within the music file, but they can also be used for information about other connected items, such as the artist of the audio, information about the release that the recording is featured on and more.

Tags are very important because they form the basis of browsing, organising and searching in your music player. When you see album and artist names in your music player, that's the tags you're seeing.

How are genres stored in music files?

One of the tags stored is the genre of the music stored within the file. In theory, this could vary from track to track, although convention is to associate the same genre with each track of a surrounding release (album, compilation, EP etc), when one exists.

There's nothing special about the storing of the genre. In modern tagging formats, the genre text is simply stored inside the music file against a well agreed field name or label. In older tagging formats there was an attempt to mandate a list of genres, but this approach has largely been rejected.

Given the genre is simply stored as a piece of text within a tag with a well agreed label, it's straightforward for software to update the genre information.