There can be several reasons. Each of your examples seems to have a different one.
As a general rule, governments need the support of the populace for programs to avoid terrorist attacks. Thus, Secretary John Kelly in the United States warns of future attacks in hopes of support for more resources for his Department of Homeland Security, which is supposed to stop such attacks.
In France, they mention a left-wing prime minister acknowledging the likelihood of future attacks while talking about a right-wing presidential candidate's proposals. If the prime minister instead said that attacks were not likely, then the next attack would tend to push support to the right-wing candidates. They would say how he had no idea of how the real world worked. By acknowledging the attacks, he blunts that future event at the cost of some current support for his position.
In Germany, this seems to have been a mostly internal report from the Intelligence head to the government that was then reported publicly. I.e. his reason was to let the rest of the government prepare. But in a transparent society, letting the government know often briefs the public as well. However, we wouldn't want the government to be making its decisions based on false pretenses.
There could be other reasons that are not as obvious from your examples. But this covers a nice range. Garnering popular support, trying to control the political narrative, and informing other parts of the government are all important things to do from the perspective of a government employee or politician.