This comes from IbnEzra on the pasuk in Vayishlach about the people of Shechem. The Mishna in Shabbos Perek 9 Mishna 3 cites this pasuk.
Vayishlach 34:25
וַיְהִי֩ בַיּ֨וֹם הַשְּׁלִישִׁ֜י בִּֽהְיוֹתָ֣ם כֹּֽאֲבִ֗ים וַיִּקְח֣וּ
שְׁנֵֽי־בְנֵֽי־יַֽ֠עֲקֹ֠ב שִׁמְע֨וֹן וְלֵוִ֜י אֲחֵ֤י דִינָה֙ אִ֣ישׁ
חַרְבּ֔וֹ וַיָּבֹ֥אוּ עַל־הָעִ֖יר בֶּ֑טַח וַיַּֽהַרְג֖וּ כָּל־זָכָֽר:
Now it came to pass on the third day, when they were in pain, that
Jacob's two sons, Simeon and Levi, Dinah's brothers, each took his
sword, and they came upon the city with confidence, and they slew
every male.
Ibn Ezra says that on the third day the pain of the circumcision was at it height. The way it appears from what he says, is that the trauma and pain builds up to a maximum by the third day and then the healing process starts in earnest.
ביום השלישי – הוא לעולם קשה, שהוא חצי המרובע.
Similarly, רד"צ הופמן agrees with the IbnEzra that the pain was at its worst on the third day.
ביום השלישי – כי אז הכאב גדול ביותר; השווה מסכת שבת, פרק ט׳ משנה ג׳
ותוספות יו״ט שם.
The mishna says that we learn from this pasuk that
?מנין שמרחיצין את המלה ביום השלישי שחל להיות בשבת
Rav Kahati explains (in the name of the Meiri) that the first two days were also a סכנה and allowed to heat water on שבת, but that Shimon and Levi were considering whether or not to actually kill the people of Shechem, but they realized that if they did not do it on the third day, the people of Shechem would be recovering and be able to fight back.
He also cites תוספות יום טוב and תפארת ישראל
ויש אומרים שדווקא ביום השלישי מתגברים הכאבים והנימול מסוכן הוא אבל
ביום השני למילתו אין בו סכנה
My translation
There are those that say that it is specifically the third day that
the circumcised person is in danger, however on the second day, there
is no danger.
Daas Zekainim and Chizkuni are cited by Art Scroll as stating that it took three days for everyone to have been circumcised and be in pain and weakened from the operation. They then attacked while they were all weak before they were able to recover. This is also said by Ri Bechor Shor
{ביום השלישי בהיותם כאבים} – כי בשלשה ימים נימולו כולם, וביום שהיו
כולם נימולים וכואבים באו עליהם. (ר״י בכור שורא בשם ורבי יוסף קרא אמר)
Rashbam said that by the third day, they were all suffering from the pain of the first two days and had not yet started to heal.
בהיותם כאבים – לפי דרך ארץ ופשוטו של מקרא: אז היו כאבים מיום ראשון
ושני.