Different OSes use different path separators. For instance, Windows uses a backslash \ to separate directories while Unix based systems (e.g. Linux, macOS) use a forward slash / to do the same.
Using path.join, you make sure that your path is concatenated with the right separator for the OS it is running on.
In contrast, if you had used normal string concatenation functions or operators your path separators would have been hard coded, so to speak and your script/program would've worked on one system but failed on another.
In platform agnostic programming languages, like JS, it is important to outsource platform specific functions to such libraries to make sure that our script is robust enough to endure different OSes.