Uniswap v2 and all derivative platforms had a serious problem - they were not capital efficient.
Concentrated Liquidity
Uniswap v3 allows liquidity providers to concentrate their liquidity between two prices, instead of the entire curve.
Within a single pool, LP’s can combine any number of concentrated liquidity positions.
Example: Alice deposits $1M worth of capital into a v2 ETH-DAI pool, and Bob deposits $183.5k of capital in a v3 ETH-DAI pool between the price of 1000 DAI to 2500 DAI. This means that while the price of ETH is between 1000 DAI to 2500 DAI, Bob is earning around 6.3 times the amount of transaction fees.
However, if ETH moves outside of that price range, Bob is making no money from transaction fees.

Liquidity positions are represented by NFT’s.
Fees in concentrated liquidity are much higher than normal liquidity
Ticks and Visualizing Concentrated Liquidity
Uniswap v3 breaks apart the entire price curve into sections called ticks.
Each tick is identified by an integer $i$. The price at each tick is defined as $p(i) = 1.0001^{i/2}$. This gives the nice property that each tick is the square root of 0.01% away from the next tick.
Price moves nonlinearly but sqrt(price) moves linearly with respect to liquidity. For liquidity to remain constant across a tick, it must be defined in sqrt(price) space.
When specifying concentrated liquidity, users will place their liquidity between two ticks.

You can imagine the space between two ticks as a bucket where liquidity can fall. The height of the bucket represents how much liquidity is in each bucket.
Back to our Alice and Bob example, how is Bob returning around 6.3x more value in v3 compared to v2 (in his current price range)?
Capital efficiency between v2 and v3 can be realized by the ratio of range widths
Uniswap devs empirically analyzed that the full range width (v2 range) is around 115.5 sqrt-price units.
115.5 is essentially the entire realistic price domain in which ETH trades converted into v3’s sqrt(price) system.
So now calculating capital efficiency:
sqrt(2500) - sqrt(1000) = 18.38
Capital efficiency = 115.5 / 18.38 = 6.3
Providing Liquidity in Uniswap v3

Swapping with Uniswap v3
Within a tick, the swap acts like the virtual liquidity function. If a trade crosses a tick, then the pool parameter is updated and then trading continues into the new tick.
By definition, if a trade crosses a tick, then all of the liquidity in that tick has been exhausted. For example, the trader may want to receive asset A but this tick no longer has any asset A to give.

Real and Virtual Reserves

Concentrated Liquidity as a Limit Order
What happens exactly when a v3 position’s price is not within the price range?
The liquidity position is entirely turned into one asset.
This is key to v3’s design and ensures:
For example, let’s say I have a position in a USDC-ETH pool between the prices of 2000 USDC and 2200 USDC. If the price of ETH is higher than 2200 USDC, then my position will consist entirely of DAI. If the price of ETH is lower than 2000 USDC, then my position will consist entirely of ETH.
This has the effect of minimizing impermanent loss because after some price deviation, the user stops trading the more valuable asset for the less valuable asset.
Some people use this feature to sell one asset for another at a predetermined price. This is called a range order.
For example, I place a range order to sell DAI between the price of 1.001 to 1.002 USDC. Let’s say I start with 1M DAI and the price of DAI is less than 1.001 USDC. When the price of DAI increases, my DAI will get swapped for USDC until I have no more DAI and my position is entirely USDC.

Observations
Uniswap V4
Further Reading