When the two ships are cross to each other they create a narrow stream of flowing water due to Bernoulli's effect the pressure reduces in between the ships while the water flowing outside part of the ship flow at a slower velocity this produces a corresponding increase in pressure.This makes the ship to be pushed towards each other.