It uses notification access permission provided by users to keep track of their notification history and to make them view deleted whatsapp messages. Users have all the control of allowing or disallow permissions.

Names used in this description are for demonstration purpose. All names are copyrighted to their owners like WhatsApp is copyrighted to WhatsApp Inc.

 Download Whatsapp Deleted Message & Photos Recovery App (Source: Google Play Store)