As the name suggests, a delivery fee is a fee charged before the cargo is delivered to the customer.
The shipping line and/or the port can charge a delivery fee. The shipping line will charge it based on the services they need to provide before the delivery is done and cargo is released, such as the documentation required for the release, the updates to be done in the port, and the customs system for the release.
The port may charge it based on the actual delivery of the cargo.