Understanding the Electrochemical Properties of Li-Rich Cathode Materials from First-Principles Calculations