When giving discounts to your customers often you want to only apply that discount to your main product and not to the delivery fee. Just as you can exclude extras from being discounted in the Extras configuration the delivery fee has this setting in the Discount Settings & Codes.
In the Discount Settings you can toggle the switch to "Apply discounts to delivery" to apply discounts or not:
Setting up extras
What is 'a delivery' in the system?