The starting material (2-aminobutane) is a racemic; it has equal amounts of R and S enantiomers.
Enantiomers have the same the same chemical and physical properties, so we can't separate them using common lab techniques, such as recrystallization, chromatography, etc. But diastereomers can have different properties, and we can exploit this fact to separate otherwise inseparable compounds.
Adding an optically pure acid to the amine produces a diastereomeric mixture of salts which can be separated. Adding a base (NaOH) "breaks" the salt and allows us to isolate the pure R or S amine.
We are able to separate the (R,R) and (R,S) salts because they are diastereomers and so have different chemical and physical properties.