Haglund’s deformity is caused by a combination of the genetic shape of the heel bone (calcaneus) and pressure from the footwear. Haglund’s is a prominence of the bone at the back of that heel bone and that shape is determined by your parents. Everyone has a slight prominence in the area at the back of the heel bone and there is substantial variability, so that just means that some are bigger than others. If you have a larger bit of bone there, then it is more likely to rub on the shoes. This rubbing and pressure from the shoes causes a bursa to form and possibly become inflamed. Haglund’s deformity is also called a retrocalcaneal bursitis for this reason.
Just becasue the area of bone is enlarged does not mean that you are going to have a problem. The problem is determined by the fit of the shoes around the heel. If the shoe are more rigid (eg ski boots), then that pressure is going to be high and the risk of a problem developing is high. If you never wear shoes, then it is never going to be a problem.