In the animation below, I don't understand why the brightness slightly decreases when the planet is behind the star.
Where does this effect come from?
Just before the planet goes behind the star, we see the light directly from the star as well as the light reflected from the planet's surface. When the planet is behind the star, we no longer see the reflected light.
Note that the top of the line also curves to reflect how much of the planet's surface is illuminated from the star. The most illumination is when it is almost "full" just before it passes behind the star. The least illumination is when it is "new" just before it passes in front of the star.
Edit (to address Fraxinus's comment below): Here is an example from Zhang et. al: Phase Curves of WASP-33b and HD 149026b and a New Correlation between Phase Curve Offset and Irradiation Temperature.
The above graphic shows processed data from the Spitzer space telescope. From the paper:
Observations were timed to begin before a secondary eclipse and end after the following secondary eclipse,
These light curves help aid in estimates of planetary albedo, day/night temperature, and atmospheric composition.