Captain of an airliner is the Pilot in Command, it's the same reasoning as in merchant naval terms. The Captain of a ship in civilian terms holds the legal position of "Shipmaster" or master. So if a ships master can refer to themselves as a "Captain" so can the leader (PIC) of an airline crew if they are bestowed that rank by their company. Airplane Captain has a dictionary entry under the naval version now as well. Of course Military ranks are commissioned so that's a different meaning. Remember that in legal terms however you are either the PIC or a Co-Pilot, there's no Captain, 1st, 2nd, cruise officer or such. However your ops manual will give each role a legal run down of what you might be responsible for under the delegation from the PIC.