Stored XSS occurs when a web application gathers input from a user which might be malicious, and then stores that input in a data store for later use. If the input that is permanently stored is not correctly filtered, then malicious data will appear to be part of the web site and run within the user’s browser under the privileges of the web application.
Reference link - https://owasp.org/www-project-web-security-testing-guide/latest/4-Web_Application_Security_Testing/07-Input_Validation_Testing/02-Testing_for_Stored_Cross_Site_Scripting
Reference link for XSS Payloads - https://github.com/K-sahu/Web-Application-Security-Testing/blob/main/XSS%20Payloads