Nearly and almost are essentially the same. They mean that somebody or something came close to doing something… but did not do it.
For example, if Jane is running in a race and came in second place, just a couple of seconds behind the winner, then you could say:
If your computer battery only has 8% power left:
The words almost and nearly describe being very close to some limit (0% power) or action (winning the race).
The word mostly means generally, usually, or more than half. If it is “mostly cloudy,” then it means the sky is more than half covered with clouds. Mostly describes a proportion, the greater part.
If there are 20 people in an English class and 17 are from South America but 3 are from Asia, then “the students are mostly from South America.”
There is also a difference between “most of” and “almost all.” “Most of” means more than 50%, and “almost all” means close to 100%.