Ghee separating into two layers with different textures indicates temperature fluctuations during storage. It's perfectly safe to consume and should be mixed back together for a consistent texture.
Ghee, being primarily composed of different types of fats, can exhibit phase separation when subjected to varying temperatures. The harder top layer typically consists of saturated fats, which solidify at slightly higher temperatures. The softer bottom layer contains more unsaturated fats, which remain softer at the same temperature. This separation is a natural phenomenon and doesn't indicate spoilage or any degradation in quality. The ghee is still perfectly good to use. To restore its uniform consistency, simply warm the ghee gently until it melts completely, then stir thoroughly to recombine the separated layers. Allow it to cool slowly and evenly to minimize future separation.
To prevent ghee from separating in the future, store it in a cool, dark place with a consistent temperature. Avoid repeatedly taking it in and out of the refrigerator, as this can cause temperature fluctuations that promote separation.