A Commander is one who gives commands or has command over others. The word "command" comes from the Latin mandare that meant to give into one's hand, that is, put somebody in charge of something so he could command it.
As a rank, Commander appeared in the British navy about 1674 as "Master and Commander" to designate the officer under the Captain who was in charge of sailing a ship. He might also be second in command. The position had also been called sub-captain, under-captain, rector and master-commanding.
The Master and Commander could also command a smaller warship in which case he would be addressed as "Captain." Since every warship had a Captain, the British worked out a system of three grades of Captain depending on the size of ship commanded. The Master and Commander became the lowest of the three grades. In 1794 the British cleared up the confusion a bit by shortening the title to just Commander. Our Navy took a different route but reached the same point a few years later. The second of the three grades of Captain was Master Commandant, which in 1838 became Commander. The third or lowest grade of Captain was Lieutenant, Commanding which as we have already seen became Lieutenant Commander in 1862.
In 1862 Commanders began wearing embroidered silver oak leaves as rank insignia. They wore the leaves along with fouled anchors on their shoulder straps and epaulettes. In 1869 the Commander became a "three- striper" when he started wearing three one-half-inch wide stripes of gold lace on his sleeve cuffs.