Because you can’t cook on Shabbos, but you can cook on Yom Tov if the Yom Tov falls out on a weekday.
The Gemara (I believe in Be’ah) is of the opinion that theoretically, the 2nd day (biblically) is like *chol* in which case you would be insulting/desecrating the first day by preparing for the 2nd day.
This is why we wait late at night to start 2nd day (neros, etc…) so as not to come to desecrate the first day.
When the 2nd day is Shabbos, we have to finish prep. by a bit before sunset, because Kedushas Shabbos is highest compared to Kedushas Yom Tov.