Mines are designed to be ejected from a ship, and remain on-station and in-active until an enemy ship is detected.
When an enemy ship enters the mine's sensor range the mine activates. Some mines actively seek targets when activated, others simply detonate.