Simulation distance

Simulation distance is a world-creation setting $$ that controls mob spawning and despawning, and tick updates. As of Java Edition 1.18, simulation distance was introduced as a video setting related to render distance, to restrict tick update distance.

Control
The simulation distance control appears in the settings page when creating a new world. The values that can be set range from 4 to 12 in increments of 2 (even numbers only).

Tick updates
Simulation distance determines the maximum chunk distance in which entities get updated, and blocks and fluids are ticked. This is not a Euclidean distance, but taxicab distance in Bedrock Edition.

Spawning and despawning
Simulation distance restricts the maximum distance at which mobs spawn and despawn.

The minimum spawning distance is 24 blocks (Euclidean distance) from the player. The maximum spawning distance and despawning distances are determined by the simulation distance, which is a quasi-spherical shell having the following ranges relative to the player:

Within the simulation distance, there is a $11/2000$ chance of the mob spawning algorithm attempting to run per chunk, per tick.

Realms supports only a simulation distance of 4.

Regardless of simulation distance, mobs with persistence do not despawn, and fish always despawn when they are more than 40 blocks from the nearest player.

Mob cap
Mobs in chunks outside a ticking area still count toward the per-mob population control caps as long as they were previously loaded within the simulation distance at some time.

Java Edition
In Java Edition, the minimum value of simulation distance is 5. The maximum value is the same as for render distance: 32 for 64-bit Java installs with at least 1 gigabyte of memory, and 16 in all other cases.

Simulation distance is related to render distance (the maximum distance at which chunks are visible by the player). As with Bedrock Edition, simulation distance affects the maximum chunk distance in which entities get updated, and blocks and fluids are ticked.

The simulation distance setting is ideally less than render distance because updating all entities within the simulation distance is more taxing on performance than the equivalent level of render distance.