I mean, the mods and versions always go to the main directory, and I have to hope that they don't interfere with each other. Maybe this is ensured due to how versions are stored. So installing into main directory and selecting a version in the Launcher options should be enough separation.
My confusion was based on how I started to use separate game directories. I copied the content of .minecraft to the new directories, and in this case I could install mods into the new directories. But the launcher couldn't find the installations.
For me the topic is done. Thanks for increasing my knowledge.