In the late 19 century during the explosion of the industrial revolution, the need of a structured and generally applicable algorithm of keeping things organized became apparent.
Gantt was a mechanical engineer of that time, in charge of building ships for english royal navy, which was engaged in ww1 effort. Being confronted with challenges of delivering on time, he came with a simple idea of laying down the sequential tasks involved in a creation of a ship.
Indeed, the very nature of such an activity as ship building gives already all the ingredients (later in much detail explored by the professionals), of properly managing a project. It gives a well defined scope (the ship itself), the time (England was at war at that time, being obviously in need of building ships in the smallest amount of time possible), and last but not least in need of money (everybody needs money, especially when it happens to have a war to keep).
So the three components of a project management (scope, budget and time) were in place, and the need of a structured approach of the challenge came naturaly.