Because when the expression isn't parenthesized multiplication and division are done before addition and subtraction. Then it proceeds left to right. So it's as if it were
5+(5*5)-5+5
5+25-5+5
30-5+5
25+5
30
There is a rule somewhere about posting your homework questions here, and this really feels like a homework question.