If you look at current-day small vessels and submarines in the U.S. Navy and Coast Guard, you'll find quite a few ships are skippered by full lieutenants, lieutenant-commanders
In fact that is exactly how the rank of Lieutenant Commander came to exist. It's not a junior version of Commander - it's a more senior version of Lieutenant. Officers with Lieutenant grade were being put in command of smaller ships, and there needed to be a way to differentiate these Lieutenants from those who were not in command of any ship.
As for the rank of Commander itself, I always assumed this dated back to the old days when a ship's Captain was only the OWNER of the ship. They left the day-to-day running of ship operations to another officer. This was the actual 'commander' of the ship, thus the rank of Commander was born.
If this last bit is inaccurate, please feel free to correct me.