If a project is represented in the standard format, the paths are relative to the directory where the *.ipr file resides. If a project is in the directory-based format, the paths are relative to the directory where the .idea directory resides.
The paths for a module are stored relative to the directory containing *.iml file.
Using path variables enables you to store the projects paths as named variables in the format <path name>-<value>.
On saving a project, all occurrences of the local paths, specified as variables, are replaced with the macros in the format $<path name>$.
When a project opens on a different computer, MPS replaces the macros with the respective local path values. If such shared project opens on a computer that does not have the needed path variables, IDE requires to define them.
Path variables are defined in the Path Variables page of the Settings dialog.