There is a basic explanation of the credit exchange concept at definitions.

For this extended example, consider node A, which can route payments between any three nodes B, C, and D.

 B - A - D

A is more friendly with nodes B and C, less friendly with node D. So A charges no transaction fees for payments routed from B to C or C to B. Nor is there a transaction fee for routing payments where D is the payer. However, where D is the payment recipient, A charges a transaction fee of 2%.

Node A's exchange rate table is:

 B-A -> A-C: 1
 C-A -> A-B: 1
 B-A -> A-D: 0.98
 C-A -> A-D: 0.98

Every node stores an exchange rate table like the one above, which it uses when acting as a payment intermediary between any two neighbors.

A node could store a very high exchange rate to discourage exchanges it does not want to do. It could store a very low exchange rate (or no fee at all) to encourage exchanges it does want to do.