Understanding and prediction of electronic-structure-driven physical behaviors in rare-earth compounds