The Mishna in Sanhedrin says that if one witness says he saw an event on the third of the month and another says he saw the same event on the fourth of the month we assume they are testifying about the same thing and one of them got the date wrong. Determining the correct date requires knowing whether the previous month was 29 or 30 days; that knowledge was often not well known until mid-way through the next month.
The Yerushalmi (5:3, 25b in Vilna ed.) quotes R' Asa as saying that he never davened musaf on Rosh Chodesh without knowing the date with certainty. Meaning, R' Asa made sure to know in advance whether Rosh Chodesh was be day 1 of the new month or still day 30 of the previous month and there would be a second day of Rosh Chodesh. The Tzion Yerushalayim notes that this gemara is a source for the custom (which I honestly had not heard of before) of checking the molad in advance to be aware of the exact day of the new moon's appearance.