Hey there!
The peppered moths actually turned black as a result of the soot from factories changing the color of the bark on the trees - their habitat.
They all turned black because the ones during the Industrial Revolution were turned black, and this caused a mutation, so when they bred with others, their offspring turned black, causing them to ALL turn black.
Have a terrificly amazing day!