What is the function of acid catalyst in esterification reaction?

By function, I mean how it works. Thanks in advance!