All songs and metadata including the lyrics are provided by the Rights Owner/Publisher of the song. In some cases they will upload a clean version and an explicit version. The only thing Apple does is filter out the explicit songs so they do not appear in Apple Music for you to play them if you have restricted access to the explicit songs. There is no censorship going on by Apple at all with any of the content in Apple Music, that would only be done by the Right Owner/Publisher.
You can check if your Apple Account is currently restricting access to Explicit content, but other than that it is nothing Apple is doing.
Set or change parental controls in Apple Music on the web - Apple Support