If there is a personal or cumulative discount in the customer card, the largest one will be automatically substituted in the "Percentage discount for an order" field, when creating an order.
Let's look at an example.
For example, in the system settings, you have created a rule that adds a 10% discount to the customer for their next order if the sum of the previous order is equal to or greater than 500 euros and the order is in the "Completed" status group.
When enabled, the "Recalculate cumulative discount" function recalculates the cumulative discount for all customers at once. The function can be used when the store already has a customer base in which it is necessary to recalculate the cumulative discount for old customers.
If an order is created via API with a customer specified, while the customer has a discount, and the discount is not specified in the order, the system does not automatically substitute the discount. If you want to substitute a discount via API, then you need to get the customer data via API and explicitly substitute the discount into the order being transferred.