Someone who “knows the ropes” is experienced, and understands how to do whatever it is they are doing. “Showing someone the ropes” means to explain to them how something is done.
This phrase may have originated in the golden age of sailing, when understanding how to handle the ropes necessary to operate a ship’s sails was an essential nautical skill. But it may also have come from the theater world, where stagehands use ropes to raise and lower scenery, open and close curtains, and lower heavy props. By the mid-19th century it was a common slang expression, and it still is today.
Support for the first source comes in Richard H. Dana Jr’s Two years before the mast, 1840:
“The captain, who had been on the coast before and ‘knew the ropes,’ took the steering oar”
It doesn’t refer specifically to ropes, but clearly has a seafaring connection.
There are also early citations that come from the theater. J. Timon, in Opera Goer, 1850 includes this:
“The belle of two weeks standing, who has ‘learned the ropes’.”
I would guess that sailors have been using ropes longer than stagehands in theaters, since I’m sure that humans have been fishing longer than they’ve been telling stories. If I truly “knew my ropes” I’d know which activity created that phrase!