Why were helmets seemingly phased out during this period of time in favor of wearing tricornes, shakos, kepis, and forage caps in battle? Prior to this, during the 1500's and 1600's, they still had morion and lobster-tailed pot helmets but then these were gradually phased out by hats like those mentioned above. Why though? Why didn't they keep on wearing helmets as they seem much more practical for headgear and protection than a hat
One big reason for the demise of the helmet (and armour in general) was the shift from bladed weapons to firearms. With soldiers relying on exchange of fire rather than melee fighting the helmet lost most of it's usefulness. Note that many cavalry regiments maintained their use of some form of helmet as their fights were still primarily with the sword so the helmet was still useful.
The reintroduction of the helmet in WWI was primarily to provide protection from artillery fire as research had shown that overhead shell bursts caused a large number of head injuries to troops in the trenches. The British style helmet with it's wide brim looks to modern eyes to not provide much protection but was a good design for protection from shell fragments from air-bursts.
I am by no means an expert - and there is almost certainly someone more qualified on this sub to answer this - but as there are no answers so far I will inform you as best I can. In this period European warfare was seen from the perspective of the combatants in a manner alien to us today.
The horrors of WW1 and 2 had yet to happen and war itself in many cases was seen as a grand and honourable affair; fought between great rivals with mutual respect on both sides in many cases. As such, armies were dressed and behaved such as to give off a visual impression of grandeur and to seem impressive - you have to remember these armies would often meet in battle in orderly lines, with drummers playing motivational music to spur soldiers on in battle. The interesting hats you see associated with many European armies of this period are a side effect of this estranged attitude to war, and the importance placed on the visual prestige of armies, and this attitude would pervade into the first few months of WW1 when thousands upon thousands of French troops - dressed in full traditional French uniform - would be killed en masse before trench warfare and khakis/camouflage became standard issue. Even at this time many forward thinkers saw practical uniforms such as khakis as 'dishonourable' and this attitude had taken much time to change.
There could also be a technological argument - I am certain at the introduction of guns and musketry the quick phase out of armour was due to their effectiveness at penetrating heavily armoured units and effectively rendering it useless. I cannot comment on the effectiveness of armour designs in this period however from a ballistic protection standpoint, but it's possible this was an issue.