What is the purpose of a companion plugin

If you put your functionality in a plugin then it can be reused across many themes.

E.g. a plugin that adds font options to the customizer would be useful for lots of themes, but if it was directly built into every single theme and you needed to make a change, you would have to release updates for every single theme, then make sure there were no version differences and they were all kept up to date. That isn’t an issue with a plugin.

Additionally, themes aren’t intended to host functionality such as post types etc, only templates and visuals. Almost all themes break this advice though, but it’s still useful. E.g functionality built into a theme locks you into that theme and is lost when you switch.