The Lightning Network relies on the Bitcoin protocol to operate, so it is important to understand how your Lightning Node interacts with it.
The Bitcoin network is often called “Layer one” and the Lightning Network, “Layer two.” Your Lightning Node has an on-chain wallet built into it. This wallet allows you to send and receive bitcoin as you normally would.
The channels that you will inevitably open are funded by this on-chain wallet. When your channels close, this wallet is also where the funds on your side of the closed channel will appear after confirmation.
Your node’s seed phrase that you wrote down during your node’s initial setup will help you recover these on-chain funds should your node fail.
Every time funds move through a lightning network channel, an on-chain transaction is updated (But not yet broadcast)and signed by both parties. Each peer now has access to a broadcastable transaction with updated balances. This is to ensure that if the channel closes, the correct amount of funds will be returned to each party on-chain.
Your lightning channel is a 2 of 2 multi-sig smart contract. Each peer has the option to close a channel at any time because both parties have access to the fully signed, but unbroadcasted close transaction at all times. To close a channel means to allocate the funds in a channel back to the bitcoin base layer.
Every time the balance of a channel changes, each peer signs an on-chain transaction updating the contract. Each peer then stores the signed 2 of 2 transaction if a closure is requested by either peer.
In the event of a cooperative close, one would broadcast the signed transaction, also known as a commitment transaction, to the bitcoin network. They would choose the fee rate and the channel would close and each peer would receive what they had on their side of the channel on-chain.