Calibre writes the metadata in a seperate file
metadata.opf. This file looks very much like the
content.opf file found in an EPUB file, but is different and also exists and has the same format, when your ebooks are not in EPUB format.
metadata.opf filecalib resides in the same directory as the book in your library, easily accessed by right-clicking the book in Calibre and then "Open containing folder"
Polishing the ebook updates the metadata in the file from the
metadata.opf. However I cannot recommend indiscriminate polishing of all the Ebooks. Mostly because the files date-time-stamp change, even if the metadata was not updated, resulting in a resynchronisation of all the file; but also because it takes more time than necessary and can cause notification overload in the system.
My self answered question How can I keep a large number of EPUB files, managed in calibre, “polished” describes a solution for only updating those Ebooks whose metadata are out of date, and in parallel. I use that before every synchronisation, it works within a second for the 2200+ ebooks I have, because most of them don't change from sync to sync.