Why do tampons stop my period?

Olyana • 💛💙💛
I just took out a tampon after 8 hours and it was completely white. I put a pantiliner on and 20 minutes later my flow is back. Whattt the hell?