Shipowners and their crews have a legal duty to help anyone in peril at sea. Part of that assistance may be that the captain decides to take people on board. An important point here is that the ship is permitted drop the migrants off at a safe port of call.
The following problems are relevant to the Central Mediterranean. The current reluctant stance of Italy and Malta to accept migrants, and the position of Libya as a country with an active, recognized coastguard but also with an insecure status, means that a ship with migrants on board may have difficulty disembarking these people. Furthermore, there is a risk that migrants, for whatever reason, are not satisfied with the port or country where they have to disembark. This has the potential to cause an unsafe situation on board.
The European Union no longer operates active missions against human trafficking. Operation IRINI aims to combat arms smuggling to Libya; its main purpose is to enforce the arms embargo. Any naval vessels involved are of course still obliged under international law to rescue people in danger at sea, but searches and monitoring are no longer actively executed. Frontex is active. Frontex is the European Border and Coast Guard Agency. Frontex coordinates multiple anti-smuggling operations, such as Minerva and Indalo in Spain, Themis in Italy (which replaces Operation Triton) and Poseidon in Greece. These operations focus on surveillance and border control in the Mediterranean Sea.