1. After you "clink" your mugs/glasses/pints/etc you cause the head, or the foam, to rise. Tapping it on the bottom causes the head to fall so that you can chug/swill the beer with less of a problem, especially in a drinking contest setting.
2. If you are in a drinking contest the sound of your cup hitting the table, before you drink, and not when you start drinking is usually what the "judges" go by, as to when you started. That is also why the cup is slammed down afterward, to signify the end of your drinking "round"