This particular question is unclear to me: is it the wallet or the nodes that generate transaction fees? I understand that transaction fees are generated, but how? Please help me out.
There's no particular entity that sets the transaction fee.
It's the wallet's estimation depending on different or unique factors; or what's set by the user.
For example, Electrum has 3 transaction fee sliders which work differently:
ETA which uses complex algorithm based from the newest blocks and mempool.
Mempool which is solely based from the size of your server's mempool.
Static which is a set pre-set values.
For generation of "
fee", it's simply the difference between the inputs' and the output's amount.
The "
fee rate" is the 'fee' divided by the transaction's virtual size.