It started off as the dual alliance. Then the Triple Alliance formed in 1882 between Germany, Austria-Hungary, and Italy. It was for defensive and conservative reasons whose main aim was to stop anyone who might threaten these three countries.
It was a treaty of friendship signed in 1904 between France and Great Britain and Russia joined in 1907. It was formed to counterbalance the threat posed by the Triple Alliance.