It is as iconic as a Parrot on the shoulder or a Peg Leg - The Eye Patch has become one of the most misunderstood pieces of Pirate lore. Pirates did in fact wear them - as did MANY people of the Period then. In truth, The Eye Patch had more of a practical use OTHER than hiding an ugly and empty eye socket. To be sure, Pirates fought. Hand to hand combat was a way of life. No doubt one would lose and eye if not careful. However hiding a once healed wound was not as vain an issue as it is today. In fact, for a Pirate - such a visible wound would have been a 'Badge of Honor" (and probably not hidden).
Some were born missing limbs or maybe even an eye. There was no such thing as Neonatal care. Poor diets, poor care (on behalf of a Mother) - and of course disease, all contributed to such birth defects. Perhaps a Sailor or Pirate might resort to an Eye Patch based on this.
However, the actual use if an Eye Patch was a tactical invention. Patches supported the ability of being able to maintain Night Vision (or training the chosen Eye to become adaptive to low level light). Regardless if an attack came Day or Night, this was a practical exercise. If during a Daytime attack, at some point - a Boarding Party would have to go "below Decks" on an enemy Ship. Low and poor lighting could cause one to go blind when leaving a bright lit deck for the darkness below. The wearing of a Patch for several hours prior to an attack, trained the Iris and Corona of the Eye to contract to it's largest diameter. This allowed all light sources to be captured by the Eye. Although it's drawback was a loss of depth perception - it was a fair trade off. Most Patches were made of leather and not cloth. This caused the leather to naturally form to the contours of the face and head. They also lasted longer. Often plain, they could be decorated too. In lieu of a Patch, often a head scarf or rag could be pressed into service.