Principles of lithogenesis