Normally, when you add liquidity, for example to a pool, you add an equal value of two tokens. Let's say you are adding liquidity to a DAI/ETH pool on Uniswap. You add equal value of both DAI and ETH. After you add your liquidity, you receive LP Tokens in return. These tokens represent your share of the total pool and are minted at the time you provide liquidity.
When someone makes a trade using your liquidity (e.g., trading DAI for ETH or vice versa), they pay a small fee. This fee is then distributed among all LP Token holders proportionally, increasing the value of your LP Tokens. Later, you can remove liquidity by burning these LP Tokens, and get your initial tokens back, along with the collected fees.
While LP Tokens can provide you with a passive income in the form of trading fees, they are not without risks. The main risk for liquidity providers is what's known as 'impermanent loss'. This happens when the price of the assets in a pool changes compared to when you deposited them. This can lead to less value when you decide to withdraw your liquidity.
However, the potential rewards from the trading fees and token farming often outweigh these risks, especially in high-volume trading pools. Thus, LP Tokens play a crucial role in decentralized exchange ecosystems by facilitating trade and providing opportunities for passive income.