Lightning payment fees are calculated by the nodes. You're relying on other nodes to route your payment. The node itself can specify how much they charge for your use of their channel.
In other words: your node is A. You have a channel to node B. But you need to send 1000 sats to node C. Node B has a channel with node C. Node B has it coded in their channel to charge 5 sats per route. So node A pays node B 1005 sats through your channel, then node B sends 1000 sats to node C through their shared channel.
Does this make sense?