Tapping the macarons on the counter tap helps remove air bubbles trapped in the batter. If too much air remains trapped in the shells they tend to cause cracks. Another reason could also be oven temperature is too high.