A naval response indicating that an order has been received, is understood, and will be carried out immediately. It differs from yes, which in standard usage could mean simple agreement without any intention to act. In naval custom, a reply of "yes sir" would indicate agreement to a statement that was not understood as an order or a requirement to do anything. The alternatives of "aye aye sir" and "yes sir" would allow any misunderstanding to be corrected at once. This might be a matter of life and death for a ship at sea.
The original article can be found at Aye aye, sir and the edit history here.