This seems like a simple question, but I couldn't find a clear answer when I googled so going to create one.
You can add a favicon by just adding a favicon.ico (or .png or .gif or other valid favicon file type) to the root of your custom theme folder.
If you'd like to have your favicon stored in a custom location, see the method described here: (Change default favicon programmatically)
If you simply want to give your theme the ability to change the favicon, without providing one yourself, you can add the setting to your theme settings folder by adding a /config/install/THEMENAME.settings.yml file to your theme, with the following settings:
features: favicon: true favicon: use_default: false