Ghee is solid at room temperature due to its saturated fat content, but it melts into a liquid when the kitchen is warm because the increased temperature provides enough energy to overcome the intermolecular forces holding the fat molecules together.
Ghee, like other fats, exists in different phases (solid, liquid) depending on the temperature. At lower temperatures, the fat molecules in ghee are closely packed together, forming a solid structure. This is because the intermolecular forces (specifically, Van der Waals forces) between the saturated fat molecules are strong enough to keep them in a fixed arrangement.
As the temperature rises, the molecules gain kinetic energy. This increased energy causes them to vibrate more vigorously. When the temperature reaches ghee's melting point (typically between 20°C to 30°C or 68°F to 86°F), the molecules have enough energy to overcome the intermolecular forces holding them in the solid structure. The molecules then start to move more freely, and the ghee transitions from a solid to a liquid state. The warmer the kitchen, the more likely the ambient temperature will exceed ghee's melting point, causing it to liquefy.
To prevent ghee from becoming rancid, store it in an airtight container in a cool, dark place, even if it's already solid. Exposure to light and air can accelerate oxidation, affecting its flavor and quality.