Grateful is an orphan word. Its base adjective — grate, meaning 'pleasing' — died out of English centuries ago, leaving grateful as the sole survivor. The root is Latin grātus, meaning 'pleasing, welcome, thankful'.
The Proto-Indo-European ancestor *gʷerH- meant 'to praise' or 'to welcome', and it produced one of the most productive Latin roots in English. Grātus ('pleasing') gave rise to grātia ('favour, thanks'), which became English grace. Grātis meant 'out of favour' — hence free of charge. Gratitude is thanks formalised. To gratify is to please.
More surprising connections hide further from the surface. Agree comes from medieval Latin adgrātāre — 'to bring to one's liking'. To agree with someone is, at root, to find them pleasing. Congratulate combines con- ('together') with grātulārī ('to show joy') — to share in someone's pleasing fortune.
The word grateful entered English in the 1550s, combining the obsolete grate with -ful. It partly displaced the native thankful, which comes from Old English thancful. Both words survive, but grateful carries a slightly warmer, more emotional tone — perhaps because its Latin heritage associates it with grace and favour rather than mere acknowledgement.