You can only board flagships, which are identified by the flag of their faction over their name. After you've crippled the ship, meaning destroying the hull, you must land grappling hooks onto the green markers on the ship's side. You will then tow the ship to a parallel position with yours. The captain of the ship you are on chooses when to board the ship. After swinging over to the other ship on ropes, you'll have to fight the crew. When they are defeated, you and your crew will receive the flagship's cargo, which usually is more bountiful than other ships.