Because electricity is difficult to store, but because of how the grid works you always have to generate exactly as much as is used. Not electricity generation fluctuates (obvious with wind and solar; all plants need maintenance; nuclear often has to shut down in the summer either because rivers don't carry enough water or are so hot that feeding warm cooling water back into them endangers fish). Demand also heavily fluctuates both over the course of a day and with the seasons.
Trading electricity over geographically large areas smoothes out some of these fluctuations and gives you more options to deal with planned outages
> nuclear often has to shut down in the summer either because rivers don't carry enough water or are so hot that feeding warm cooling water back into them endangers fish).
I don't believe this has much impact on Germany's export patterns: in fact, summer is usually the time scheduled maintenance is planned in France, because electricity usage is much lower during summer than during winter. So there's still a lot of wiggle room before France ends up being forced to import in the summer because of that phenomenon.
The main driver for import/export patterns are different consumer patterns (not all countries have the same daily load curve - for instance, France and Spain both benefit a lot from trading because France's peak use time is an hour ahead of Spain's) and renewables availability.
Trading electricity over geographically large areas smoothes out some of these fluctuations and gives you more options to deal with planned outages