Key electronic states in lithium battery materials probed by soft X-ray spectroscopy