Sandpaper grits vary from very coarse to very fine. How do you choose which grit to use for any given situation?
The answer is actually quite simple. In all cases you are using the sandpaper to remove a problem. So choose a grit that removes that problem efficiently without creating larger than necessary scratches that then have to be sanded out.
For example, you would choose a coarser-grit sandpaper (#80 or #100) to remove severe washboarding caused by a jointer or planer but a finer grit (#120 or #150) on pre-sanded, veneered plywood or MDF. And you would begin sanding with an even finer grit (#180 or #220) if you were just checking to make sure your stripper had removed all the old finish from a refinishing project.
Likewise, you would choose a coarser-grit sandpaper (#220 or #320) to sand out brush marks in a finish but a finer-grit (#400 or #600) to remove fine dust nibs or mild orange peel.
In all cases remove coarser-grit scratches with finer grits until you reach the grit you want to end with. You can skip grits, but this will require that you sand a little longer with each grit than if you don’t skip grits.
These rules apply whether you’re sanding by hand, sanding with a pad or random-orbit sander, or sanding with a stationary sanding machine.