Another important element that needs to be acknowledged is the general state of affairs leading up to the World Wars. You had a collection of very powerful industrial (and industrializing) empires who were all competing for their respective control of global affairs, and which were beset with a whole series of systemic issues and which were simultaneously decaying: the last generations who had experienced and navigated total war were dead or dying off, and many of the current leaders were described as mediocre and muddling, and the series of escalations leading up to WWI are understood primarily as a series of missteps and miscommunications and miscalculations, and so a whole gaggle of insecure powers were looking to shore up their own projections of power and became locked into a conflict only dimly understood initially, an understanding that would only begin to deepen with time and experience and as things were already rapidly unfolding.
The ferocity of total war was in large part the consequence of the interactions between huge and powerful industrial empires moving huge amounts of material and energy and making huge and terrible mistakes and judgements in total desperation. In warfare, a romantic premodern ideology and perception had to be smashed through with the sheer weight of a terrible and bloody industrial juggernaut with effects and dynamics that wouldn't be fully understood until a great industrial war was already underway. Such a fire couldn't have burned without the right conditions.