Tianli originally meant the general law of nature that everyone should follow. It has moral standards that can judge good or bad in the human world. Later the school of Neo-Confucianism developed this concept into the ultimate existence that transcends the world, while having it parallel it with renyu 人欲 [human desire] to argue for the notorious action of “cun tianli, mie renyu” 存天理,灭人欲 [preserve heavenly principle and suppress human desire].
For more about Neo-Confucianism, see https://plato.stanford.edu/entries/song-ming-confucianism/.