How does it know what config folder to use?

I remember for a long time I kept a .obsidian config only to reindex the vault after big changes. Otherwise I have separate config folders for 3 platforms (necessitated by a number of things).