Several ways depending on circumstances: by simply swimming to the ship and climbing skillfully up the sides with rope etc. Sometimes through battles that end with the surrender of the attacked crew. Sometimes just the gruesome pirate flag did the trick; many times painted in blood and or bone symbols.