This blog article is also relevant for the understanding of Rosh HaShanah:
Yom Tov Sheni (The Second Day of the Holiday)
One of the primary functions of the Sanhedrin, was keeping order in the Hebrew calendar. This involved especially two calculations; one determining when a new month began, and another determining when to add a "leap month", in order to reconcile the lunar year (354 days) with the solar year (365 days). In this essay, I shall deal with the first issue. The lunar month is approximately 28 1/2 days long. If the first sliver of the New Moon appeared at night after the 29th, the Sanhedrin would declare that day as Rosh Hodesh, with the old month containing only 29 days. If, however, the appearance of the New Moon was by day, so that it couldn't be seen, the old month would have 30 days. Witnesses who had seen the moon would appear at the Sanhedrin, testifying to what they had seen. If the testimony was credible, they would declare that day as Rosh Hodesh. Messengers were sent all over Israel to announce the day when the month began. A problem arose concerning Rosh HaShana. As it falls out on the first of the month, communities distant from Jerusalem had no way of knowing whether a particular day was Rosh HaShana, or whether it would be the next day.It was therefore instituted that Rosh HaShana, Biblically a one day holiday, would be observed on both possible days. As all other holidays fell out later in the month, there was time for messengers to get all over Israel, and even to neighboring countries. However, as Jews began living in places like Italy or Spain, any messenger would arrive too late. Therefore, Diaspora Jews had to double every holy day, because of the doubt in the date. In the fourth century, when it became obvious that the Sanhedrin would soon no longer exist, Hillel the Younger made a mathematically calculated calendar, that was endorsed by the last Sanhedrin. Logically, it would appear that a doubling of the day was not necessary any more. However, it was decreed that each community should continue to observe as they had; with Israel keeping one day (except Rosh HaShana), and the Diaspora keeping two. A concession was made for Yom Kippur, because of the great difficulty of fasting for 48 hours. All Orthodox communities observe this enactment. Reform have abandoned it, keeping just one day of each holiday. Conservative leave this decisions in the hands of the individual rabbis and congregations. Complications arise with one who lives in the Diaspora and is visiting in Israel, or vise versa. The most widely held practice is to keep what you kept at home; that is, one day for an Israeli, even in New York, and two days for a New Yorker in Jerusalem. This is the view of RAMBAM and the Shulchan Aruch. Some differ, opining to keep whatever is done in the place one is now visiting (Chacham Tzvi, YAAVETZ, Baal HaTanya). Some make a distinction between a short visit (less than a year), and a long visit (Most present day Sepharadic rabbis).The present Passover holiday, which Biblically is seven days, with the first and seventh being full holiday, similar to Shabbat, in the Diaspora, it is an eight day holiday, with the first and second, seventh and eighth, full holidays. We have two Seders, while Israelis have but one.