Build on Last Attempt has an effect if multiple attempts are allowed. When this setting is enabled, each attempt that a student makes will display the results of the student's current attempt and the overall activity result combining all the attempts. The student can see how they answered and scored on the individual attempt based on the number of questions included in the attempt.
The Attempts allowed option allows the student to keep trying the quiz. Each attempt only requires the student to address those incorrect questions from the previous attempts. Taken together, you can use these two settings to create a quiz that the student can keep trying until they get it right.