They prevent unauthorized requests from being processed.
Cross-Site Request Forgery (CSRF) tokens are unique tokens added to forms to ensure that requests originate from the authenticated user's session. They prevent attackers from executing actions on behalf of users without their consent. In a Java application, Spring Security can automatically manage CSRF tokens, ensuring that all form submissions are protected. For instance, an e-commerce checkout form should include a CSRF token to prevent unauthorized purchases.