I'm surprised nobody has bothered to check the law of the sea, as it is usually referred to.
The captain of a vessel notified that another ship in in trouble at sea has no choice but to go on a rescue mission. It doesn't matter if the vessel in "trouble" is loaded with refugees or migrants and happily steaming along at 5 knots, the captain is not allowed to second guess the problem, he has to rescue the people on that vessel or face prosecution in the country his vessel is registered in.
Obviously some countries are more assiduous in prosecuting than others, but the risk of prosecution is till there for the captain if he does not rescue the vessel in trouble.
The other part which is relevant is that once rescued, the people must be taken to the nearest safe port.
In the case of people leaving places like Libya, ports on the north African mainland may not be the nearest, and a fair number of them would not be considered safe either. and if you think that the people smugglers don't know the rules for this stuff, think again.
As for the numbers - the population of the EU is a little over 500 million. The estimated number of migrants is a fraction of one percent of that number. Do people on here really believe that the EU can't cope with that kind of influx ? There may be political reasons for EU member countries wanting to leave the problem in the lap of countries like Spain, Italy and Greece, but that's not the same as saying that the EU as a unit is incapable of coping with those numbers.