Currently, most system configuration is stored in the database, with the option to override it via files in the config/ directory. The override files take priority, and their values are shown in the settings panels.
However, users are able to edit these values - the values are then saved to the DB, and are hence overwritten by the config files, making it appear that no change was saved.
It would be great to have some method of distinguishing the source of a config setting, such that settings panels can be configured to disable overwritten setting fields (or whichever solution the core/plugin developer would prefer) to help prevent this disconnect.
With a bit of snooping, this is possible in user-controlled code (such as plugins) by checking the result of
Craft::$app->getConfig()->getConfigFromFile($this->handle)
I'll leave this Issue up, as I think it'd be a valuable distinction to show in the core CMS config pages.
Apologies, as pointed out by @khalwat, most core pages already have this configured as a warning - I seem to have managed to miss that!
I do notice that this seems to have been missed in some capacity for the siteUrl field (potentially due to the complexities involved in multi-site configuration) - should a separate issue be raised for that particular case?
I agree this should be improved. I think ideally in addition to the warning, the config settings should just get disabled if it’s being overridden, since as you say, changing them in the Control Panel won’t have any effect. Plus the current behavior means that your PHP-defined values could end up making their way into the database, which doesn’t seem right.
Just a quick note: we use Piwik / Matomo for web tracking. There the settings that are overridden in config files disappear from the CP. The good thing about this is that it removes clutter from the CP. On the other hand, an admin without access to the file system can’t see the settings. But is that really necessary..? If the fields are just disabled, but still visible, maybe a note should be added saying “overridden in config” or something...
A warning and disabled field seem to me the best option.

In general I think this is resolved in Craft 3.1, as the types of settings that would generally be overridable by config files can be set to an environment variable (#3219). We’re going to recommend that approach going forward, as it’s much simpler and clearer than overriding the value in a PHP file.
Most helpful comment
I agree this should be improved. I think ideally in addition to the warning, the config settings should just get disabled if it’s being overridden, since as you say, changing them in the Control Panel won’t have any effect. Plus the current behavior means that your PHP-defined values could end up making their way into the database, which doesn’t seem right.