AIS is initially intended to help ships avoid collisions, as well as assisting port authorities to better control sea traffic.  
AIS transponders on board vessels include a GPS (Global Positioning System) receiver, which collects position and movement details.  
It also includes a VHF transmitter, which periodically transmits this information on one of two VHF channels (frequencies 161.975 MHz and 162.025 MHz) depending on the size of the vessel.  
The data transmitted is avalable to other vessels or base stations who process it using special software and display vessels locations on a chart plotter or on a computer.
Normally, vessels with an AIS receiver connected to an external antenna placed 15 meters above sea level, will receive AIS information within a range of 15-20 nautical miles.  
Base stations at a higher elevation, may extend the range up to 40-60 nm, even behind remote mountains, depending on elevation, antenna type, obstacles around antenna and weather conditions.  
The most important factor for better reception is the elevation of the base station antenna. The higher, the better.  
I have seen vessels over 100 nm away and periodically receive information from some more distant vessels.
For more information about AIS try this
wikipedia page.