When you are within a Google Doc, Sheet, or Slides, and you have more than one person viewing it, you will see the chat icon indicated above. If you click on it, you will see a window pop-up on the screen.
You can get sound notifications every time someone posts a new message. To un-select this option, click on the gear and then un-click the setting.
Students can use this chat feature to extend their collaboration on an assignment. Teachers can use it as a backchannel, in order to understand what students are thinking as they are discussing the lesson.
Of course, this could also be used as a way for students to send notes to one another that are off topic. I don’t teach students that this chat feature is there. My students often find it on their own. Once they do, I tell them that they can use it, as long as they use it appropriately, and that’s often enough to keep them on track.