As far as I can remember, it was due to eating limes whilst travelling to America by boat. The limes were to stop us contracting scurvy, which is caused by a lack of vitamin C.
It all goes back to Captain James Cook. He made his sailors eat lemons (although they were called limes im those days) as a source of vitamin C to prevent scurvy.