Trivia time!
Yes, over a certain size. AIS class A transponders are mandatory on ships over 24meters. Smaller than that, and many people use them anyway because it's convenient. Many recreational boats use class B with lower transmit power.
Anyone can operate an AIS transponder in receive-only, enabling you to receive the data yourself. This is how sites like that operate - Many volunteers who receive and forward the NMEA string to the site. Hell, if you have one of those cheap USB-SDRs you can roll your own at minimal cost. Decoding the relevant NMEA strings (AIVDO and AIVDM, readable at 38400 baud) is a bit of a pain in the ass, as it's built around a 6-bit ASCII table. But I managed to do it with a perl hack once upon a time, so it's highly doable.
NB: While not legal, it's very easy to disable an AIS transponder temporarily. War ships often do this.
Tumbleweed
I'm glad you asked; A more reliable method for establishing position is by sending a position request via DSC (VHF channel 70 or MF 2187.5kHz), as that's a lot harder to disable. You're gonna need an ROC or GOC to do this legally, though. As well as a MMSI, come to think of it.
Source: I used to work with maritime comm systems, including installation of both VHF radios, MF radios, and AIS transponder. I have a GOC.