system
Given the following post, respond as if you're commenting on Reddit:
human
How does water traveling up a dry rag not break the laws of thermodynamics?

When you dip a rag in water, how can the entire rag become soaked over time despite fighting gravity? Where does the energy come from to allow the water to travel up the rag?
gpt
There is potential energy resulting from intermolecular forces. 

If it is energetically more favorable for the water molecules to be adhering to the molecules of the rag than to each other (because the attractive intermolecular forces between the two are stronger than those within just water) then water will be pulled into the rag. This will continue until the gravitational potential energy gained by increasing in elevation balances the reduction in potential energy that comes from sticking to the rag.