Composed of skeletal fragments of marine organisms like coral or foraminifera, the limestone is the sedimentary rock that is the composition of minerals such as aragonite and calcite. These are the crystal forms of calcium carbonate. The stone also contains small amount of silica.
That type of environment is where organisms capable of forming calcium carbonate shells and skeletons can easily extract the needed ingredients from ocean water. When these animals die their shell and skeletal debris accumulate as a sediment that might be lithified into limestone.