Reverse engineering is usually illegal, but trying to reproduce the behavior of said software by trial and error is not. That's why they mark the difference.
Reverse engineering is legal in a large number of countries - I'm not so sure it's accurate to say it is "usually illegal".
There are exceptions, though, and it's worth people being aware of whether or not it is legal in their country, but the biggest risk with reverse engineering generally is not the legality of reverse engineering itself, but that it makes it harder to justify yourself if the newly written code happens to look surprisingly like the original code.
It is not unusual for people to come up with very similar structured code if the code is largely dictated by the same functionality and requirements, and then it's easier if everyone involved can truthfully say they have never seen how the original did it.
There are exceptions, though, and it's worth people being aware of whether or not it is legal in their country, but the biggest risk with reverse engineering generally is not the legality of reverse engineering itself, but that it makes it harder to justify yourself if the newly written code happens to look surprisingly like the original code.
It is not unusual for people to come up with very similar structured code if the code is largely dictated by the same functionality and requirements, and then it's easier if everyone involved can truthfully say they have never seen how the original did it.