Cisco IOS stores its configuration in a text file (except security information since version 12 (IIRC)). On booting (or after a
config memory command), the configuration file is read and interpreted.
A version string is written in the configuration file so the boot loader can decide whether it is likely to understand the file or not. As far as I can remember, a warning is written to the console in the case of a version mismatch, but the router or switch continues to boot. It is neither necessary nor useful to have the complete version string in the file (and a configuration will load without any version string).
As one can copy config files from external storage directly to flash memory, or even boot an IOS device from a configuration stored remotely, it's useful to those who manage config files to have the version string at the start of the file.
show running-config displays in text the currently-running configuration, so it will generate the version string from the currently-running IOS as it would be written if one saved the configuration.
show version reports the version string embedded in the running IOS image, which is quite another thing. In this case, one is usually interested in the full details.