Let’s go deeper into this topic-
Journey of a message on WhatsApp
When you send a message to someone it first goes to the WhatsApp server. Then the WhatsApp server sends it to the receiver. When the receiver receives the message, it is deleted from the WhatsApp server. The message was in encrypted form and can be decrypted only on the device of the receiver.
Working of Whatsapp Web-
When you try to access WhatsApp chats on the WhatsApp web, the WhatsApp server needs not get anything from there as it is already there. Whatsapp sends the recent chats to the WhatsApp server temporarily and stores them till the time the WhatsApp web session is on. These chats are then transferred from the WhatsApp server to the device in which the WhatsApp web is already open. So this is how it works.