From Han-dynasty Ma Rong's《忠经·武备章》: 师尽其心,竭其力,致其命 — armies give their hearts, exhaust their strength, and offer up their lives. The chengyu condenses these classical loyal-service ideals.
usage
Often paired with 为 + person/cause: 为人民/为公司/为家人尽心竭力. Compare 全力以赴 (more about full effort, less about heart).