The way in which each of the three major groups of rocks forms is different