You also have to take into account the fact that the ocean surface, while flat, is bowed due to the curvature of the earth. If the seas are rough, your line of sight to the horizon is decreased. So height plays an important role, which is why you want your radar dish set as high above the deck as possible. A standard ship with multiple decks above the surface could have a radar dish set 50 or more feet above the waterline, thus increasing the distance to the horizon. There is also satellite to consider which sees over the horizon and can be tapped into.
While radar for spotting planes is the same as that used for spotting surface vessels since planes travel at a higher attitude they can be detected hundreds of miles out. Which is why if a plane drops below a certain altitude, radar does not pick it up...the horizon block it, on land or sea. Once again, many radar systems also rely on satellites if there is a need for extended ranges beyond horizon. This includes weather forecasting for ships to track...