Actually, Frederick I had made an agreement with Bismarck not to interfere in foreign policy.
You mean Frederick III, right? Frederick I (of Prussia) was back in the 1600s or 1700s. Even if Frederick III made an agreement with Bismarck and he would have become Kaiser, he could have passed reforms decreasing the Kaiser's power and increasing the power of the Parliament (Reichstag) and the Chancellor. Thus when Wilhelm II would have eventually become Kaiser after Frederick's death (unless Frederick changes the succession laws) he won't be able to do much to shape policy, which might prevent World War I and World War II since a large part of why WWI occured was because Wilhelm II was very foolish in creating alliances and aggressive in foreign policy. There is a good chance that an elected German Parliament and Chancellor would have pursued a smarter foreign policy. In fact, while Chancellor, Bismarck pursued a much smarter foreign policy than Wilhelm II. Bismarck made sure that France and Russia would never sign an alliance since that alliance would surround Germany on both sides (which would make it much harder for Germany to win a war if there would ever be one, as there was in RL).