We use for loops to iterate through arguments or through ranges of numbers, and we use while loops to test conditions in the same way as if for more generic looping purposes, especially in the form of the while read -r idiom for reading files or command output line by line. Along with the use of the variables and arithmetic expressions from Chapter 5, Variables and Patterns, and the input- and output-redirection techniques from Chapter 4 Input, Output, and Redirection, we now have the building blocks to make all kinds of useful scripts in Bash.
In the next chapter, we'll look at the specifics of defining your own commands and scripts using these skills.