Depends. The crew are usually from poor countries that don't contribute much if anything to anti-piracy efforts. The captain or owners are sometimes from powerful countries that will do something about it.
In some regions, specific countries or groups of countries have taken it upon themselves to fight piracy in the area. For example in the Somali region, protection and rescue generally comes from a U.S.-led coalition, regardless of the nationality of the ship/ownership/crew: https://en.wikipedia.org/wiki/Combined_Task_Force_151
In some regions, specific countries or groups of countries have taken it upon themselves to fight piracy in the area. For example in the Somali region, protection and rescue generally comes from a U.S.-led coalition, regardless of the nationality of the ship/ownership/crew: https://en.wikipedia.org/wiki/Combined_Task_Force_151