It's not yet known which system they're using (not everyone likes to talk about this), but at least one possible solution is used quite publicly. Booxtream, a 2 year old startup which was developed by Netherlands based Icontact, adds identifying info to image metatdata and the text of the ebooks. This system also changes internal file names to add identifiers.
The idea behind a digital watermark is that it lets publishers and ebookstores track pirated ebooks without penalizing legitimate customers. As I've shown before, it's incredibly easy to remove DRM so it's not actually an effective method to prevent piracy. Digital watermarks stand as an acknowledgement of this fact, and they are focused on what happens after the piracy.
The highest profile ebookstore to adopt watermarks is Pottermore but they're not alone. I was recently chatting with Huub van de Pol, one of the creators of the Booxtream digital watermark technology, and he let slip that he's working with a lot of interested publishers, including some in Japan.