If you open bimodal Rich Text generated by a ‘proper’ editor (such as DelightEd), you’ll see that there is a special entry in its expanded colour table which is nominally black, but named textColor. MacOS support for Dark Mode built these behaviours in during early testing last summer. Users expect two different text behaviours: some text should be set in fixed colours which must be respected regardless of the appearance, but other text is expected to change its appearance according to which mode is selected by the user (bimodal).
Implementing Dark Mode in a Rich Text editor isn’t an easy task – I know because I have been trying to do this properly in DelightEd.
As far as I can see, it’s likely to put you off using TextEdit ever again.
I write sort of because Apple neither calls it Dark Mode, nor does it work the way that you might expect it to. In Apple’s release notes for the Mojave 10.14.2 update, it neglected to mention that TextEdit version 1.14, included with that update, now offers a sort of Dark Mode in its windows.