This is somewhere along the lines of it's been real. At the end of a dinner, function, or gathering, one should stand up, shake hands with the host, and thank them.

'Thank you for the wonderful presentation. It was lovely'
'It's been lovely meeting you, I hope we can do it again sometime'

y personal theory is that by the end of the night, you just want to go home and the path of least resistance is generally to murmur some social niceties, peck a few cheeks, and get the hell out of there.

'It was a great evening, thanks again'
'I don't know how you pull these things off!'

And every now and then to shake things up a bit, I tell the bluddy truth:
't's been lovely, but I have to scream now.