To hearing vs to hear


I would like to know why the following sentences have the verb “to hear” in different forms:

1- I look forward to hearing from you;
2- It was so great to hear from you.

Thanks a lot in advance. Cheers!

I don’t know the answer, but if you post this on the grammar and idiom forum, someone there is sure to know.

I just did. Thank you.