The String library uses dynamic memory allocation to do its job (malloc and free). For a long time there was a leaking issue with free which is now resolved.
There is still a risk of fragmentation occuring when using String and given the small amount of RAM on most arduinos this leads most experienced users to advise against its use.