Earnest Money in Colorado Real Estate

What is Earnest Money? Who pays it? Who holds it? What happens to it?