Advance and retreat are normal in any battle, especially on open fronts like the coast.
The coast is, by its very nature, open terrain, making forces advancing there more vulnerable to fire and counterattack if they do not have cover and command of the surrounding heights. Therefore, controlling the beach alone is not enough for those who want to install infiltration there in the long term.
The most important factor is the mountains and heights that dominate the coast. Whoever controls it has a greater ability to monitor roads and control the movement of troops and supplies, in addition to holding high positions that can be used to support any advance or block an enemy advance.