The distribution and formation of mineral deposits in various types of rocks and geological settings.