The custom goes back to the time when communication was very slow; Jews in the Diaspora could not know when the Sanhedrin had declared a new moon and would observe two days as a holiday because of the uncertainty over which was the right day.