The factors involved in the formation of metamorphic rocks are