Three major kinds of rocks
Igneous - Formed by solidification of materials that were previously molten
Resulting rock types depends on elemental composition of molten material, cooling history of rock and processes that remove previously solidified or molten material from the parent melt.
Sedimentary - Formed by consolidation of materials that were previously loose or dissolved.
Materials are consolidated by either being cementated or compacted together.
Metamorphic - Formed by growth of new minerals out of previously existing rock without melting.
New minerals grow from existing ones when conditions that formed the original rock change. Key triggers include changes in temperature, pressure and/or exposure to the chemical action of fluids. Metamorphism is limited to conditions that do not cause melting of previously existing rock. Metamorphic rocks can form by reorganization of existing substances in a rock, or by reorganization of existing substances combined with the addition or removal of some substances. Mineral types present may or may not involve change in overall elemental composition of the rock.