RE: what is the main difference between "portability" ...
Portability and platform independent refers to the ability of a program to run on any machine without having the supporting language on that system.It is not at all necessary to have that language in which the program is developed on the system on which that program is running.
For Example: programs developed in java are stand alone and platform independent it is not essential to have jdk installed on the system to run the program developed in java.
RE: what is the main difference between "portability" ...
Portability focuses on adaptation of software in various OS by recompiling the source to make the binary compatible with the target OS and not necessarily modifying the source. If the source code strictly follows POSIX standard less likely one end up modifying it.
Platform independence focuses on ability of software to run on VIRTUAL hardware that inturn interfaces with the PHYSICAL hardware. Examples of cross-platform or platform independent languages are Python JavaScript Java etc.