The story
Qū Yuán was a minister and poet of the state of Chu, exiled for opposing an alliance he thought would destroy it. When the capital fell he walked into the Mìluó river holding a stone.
The people rowed out to look for him, which is the dragon-boat race, and beat drums and threw rice into the water so the fish would eat that instead of him, which is the zòngzi. Both explanations are given by everyone and both are almost certainly later than the festival.
What the day was first is a midsummer one: the fifth month was reckoned poisonous, the season when illness comes, and the mugwort, the calamus and the realgar wine are all about keeping that out of the house.