In Star Trek: Deep Space Nine, the Federation uses self-replicating mines to create a hidden minefield in the Bajoran wormhole.
The minefield is established during the Dominion War to prevent Dominion reinforcements from crossing the wormhole into the Alpha Quadrant. Each mine contains a device that can create additional mines, allowing the barrier to expand rapidly without requiring every unit to be placed individually.
The mines are designed to disable or destroy ships attempting to pass through the wormhole. Their ability to reproduce makes them especially effective as a strategic defense, but it also creates a major political and military problem because the wormhole is a vital transport route.
Self-replicating mines are distinct from ordinary explosive mines and from the Defiant's weapons. Their defining feature is automated reproduction, which lets the Federation establish a large barrier under wartime conditions.