If ‘K’ Is Constant, How Can Liquidity Providers Withdraw or Deposit Assets?

The 'k' in the formula x y = k is only constant for trades that occur within the pool. When a liquidity provider deposits or withdraws assets, they are essentially changing the total pool size, which results in a new, larger or smaller 'k' value.

LPs receive or return 'Liquidity Pool Tokens' (LPTs) which represent their proportional share of the pool's total reserves and fees, regardless of the change in 'k'.

What Is the Role of a Mining pool’S’share’ in the Block Reward Distribution?
How Does Transaction Batching Reduce the Cost of Cold Storage Withdrawals?
How Is the Value of an LP Token Calculated When K Changes Due to New Deposits?
How Can an Exchange Use ‘Time-Locked’ Withdrawals to Mitigate Re-Org Risks?
What Is the Difference between Pay-Per-Share (PPS) and Proportional (PROP) Mining Pool Payment Methods?
How Do Liquidity Providers Earn Fees in a DEX?
What Mechanism Allows Developers to Initially Control a Large Portion of a Liquidity Pool?
What Incentive Do Liquidity Providers Receive?