A king makes a party for the country. On the last day, he tells his children that kasheh alai preidaschem, please just my children stay another day. That is Shemini Atzeres.
Then the king says to his favorite son, I can’t ask you to stay another day and not invite the other children. But I’d like just you to stay. So how about pretend that you lost track of the days, and stay tomorrow. That’s Simchas Torah.