The compulsory carriage requirements for AIS are covered in the SOLAS V regulations under which compulsory carriage of AIS is limited to "all ships of 300 gross tonnage and upwards engaged on international voyages and cargo ships of 500 gross tonnage and upwards not engaged on international voyages and passenger ships irrespective of size".
There is no requirement for small commercial vessels or cruising yachts to carry AIS, however should they chose to do so they should be fitted with an AIS B transponder or receiver.
AIS is also a requirement for larger pleasure vessels on some European inland waterways. This varies by country and regionally by waterway.
An AIS transponder transmits information regarding the vessel to which it is fitted, which can be picked up by other vessels fitted with AIS. This information (which includes the vessel's identification, whether or not it is underway, and if so where to) is manually input and therefore is only as reliable as the operator.