Adding salt to butter is a common cooking technique that has been used for centuries. Salt is known to improve the flavor of butter, giving it a more savory taste. Beyond that, salt acts as a preservative, helping to extend the shelf life of butter.
It also helps to prevent spoilage by reducing the amount of moisture in the butter, which can cause it to go rancid. Salt can also be used to inhibit the growth of some pathogens, further increasing the shelf life of butter.
Finally, because butter is often very creamy, adding a bit of salt can help to give it a little bit of texture. This helps in many recipes as it gives the butter a bit of structural integrity, preventing it from becoming overly soft or greasy when cooked.
All of these reasons are why adding salt to butter is such a common practice, and a staple of many recipes.