There are verbs that can take either.There's not much difference but only one lik to can be specific and like ing(gerund) can be general.
Compare the following:
I like to eat pizza when I'm alone at home;I like to cook good meal cheeseburgers,fried chicken and meatloaf when all the members of the family are at home.(here you specified what really you like to eat and to cook).
I like eating and cooking.(here,you mean in general,no specific food and cooking in general.
From this simple context, the core meaning is the same. But there is a subtle difference. A few verbs in English falls into this category. i.e. Love, hate, like etc..
But learners should be aware that if I say I like seafood, I already including the "eating" part. I won't say "I like to eat seafood" which is a common mistake by learners, at least many learners of Asian origin I have observed because of the natural translation process in their head converting the conceived idea in theiown dialects into literal English. I may also mention that the choice between gerund and the to-infinitive sometimes depends on the rest of the context. So there isn't a 100% fail-proof explanation for guidance. So " I like to eat fish", or " I love drink beers" is " funny English". Avoid it if you can. Instead, say " I like fish" and " I love beers"