There is no single reason why the two world wars took place, it is a combination of many reasons that drove countries to declare war against each other and in bit the wars Germany was the main participant with the allied forces fighting against it...
The entire history of mankind is of wars. The wars occur owing to imperialist, expansionist, colonialist and racist tendencies. With advance of technology, the entire world is a global village. Hence war is also global and world wide whereas this was formerly limited in smaller boundaries.
For greediness ,due to jealousy,friendship, to rule to other country, for not obedient due to arrange property, to have good sources of othe countries etc