Origin of granulites