In World Wars I and II, the U.S. Navy had specialized ships designed or adapted to lay mines. Offensive minelaying could prevent enemy warships from leaving port or vital supplies from arriving.
Ships capable of laying a tactically relevant minefield need the range and endurance to get where the mines should be deposited, a large internal volume to store the mines, and the ability to get them off the ship and into the water. It is no wonder that some of the ships adapted for the role were ferryboats, which can efficiently load and offload vehicles.
Many ferries operate on short distances and return to home port for fuel and maintenance. But others in coastal or regional services have sufficient endurance or can be modified to have adequate range to travel long distances and the speed to keep up with a task force.