What's happening is that every subtraction can be written as "addition of the opposite."
18-5 = 18 + (-5)
One reason this is done in the work you showed is that they're trying to show why you distribute the negative and the 1 into the parentheses, why you multiply everything in the parentheses by "-1" and not just 1.
The other reason is to later to be able to move the individual terms around, so you'll be able to combine like terms.
When you move terms around, the sign has to stay attached to the term, so writing all the subtractions as addition helps keep the sign attached.