Very difficult question without a clear answer. Semantically, there is no clear difference or rule for differentiation. That means, usually you can use both without changing the meaning of the phrase. However, there are use cases where one or the other are typically used. Take notice when you encounter them during your studies you should stick to the version you found in a specific context.