There are lots of misconceptions about guild wars. People thought that a guild war can only be done if a player has a guild they belong in. However, that is not a necessary thing. Anyone can declare a guild war on an existing guild as long as they destroy the flag of the guild that is placed on the top of the guild's headquarters.
So, what is the purpose of a guild war? That depends on the situation. The guild that got a declaration of guild war from an individual or a guild will be given an allocated amount of time to prepare for the attack which is usually around 4 hours after the guild flag was destroyed.