When using the SetText() functions, in the Editor we sync the content with the .text property. This results in allocations as a result of strings being immutable.
At runtime, to avoid allocations, we do not sync the content of SetText() with the .text property to avoid allocations.
This behavior is by design.