Trench warfare began after Germany failed in its intitial plan to take Paris as quickly as possible. Because they ran in to a stalemate in which the British and French stopped the German surge, that was when both sides dug trenches and waited it out
hope this helps