Answer
When firms exit, less resources are allocated to the production of the good.
When firms enter the market, more resources are allocated to the production of the good.
This entry and exit would cause the long run equilibrium to be formed in the long run.
Work Step by Step
Since resource allocation is determined by the market forces of demand and supply, when firms enter a purely competitive market, the supply would increase, and the supply curve would shift rightward. Assuming ceteris paribus, the demand curve remains static and thus the equilibrium quantity increases, and more resources are allocated to its production.
Conversely, when firms exit a purely competitive market, the supply would decrease and the supply curve would shift leftward, causing the equilibrium quantity to decrease and thus less resources are allocated to the good's production.
This would in the long run cause the long run equilibrium to be at the average cost curve, ensuring that all firms earn normal profit in the long run, where there is no incentive to leave or enter.