4 shows the remainder, because 100/8 is 12 remainder 4. However if you want a decimal answer, you have to keep going in the division. So you're gonna bring down another zero after the decimal point in the 100. (100 is the same as 100.0)
40 goes into 8 five times, so the five goes after the decimal point in the quotient. So that's why 100/8 is 12.5.
I hope this helped!