That's a setting you can configure. You can also choose whether it shows the sender's name.
There's reasons unrelated to this for why you want to not show the message/sender - namely devices like a desktop you might be screensharing from or if you're concerned about someone seeing it over your shoulder.
I almost leaked a message just taking a screenshot because I didn't notice the notification immediately so I keep it disabled.