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!

Hi ,

The structure is: look forward to doing.


Thank you, Alan.