It doesn’t do anything fancy. There are data sets from different data breaches with e-mail addresses. The site has just indexed these to let you know which data sets that address appears in. If you were sufficiently motivated, you could find and download the data set yourself and do a CTRL+F inside it (though sometimes they are several gigabytes).

The data sets are not just from websites you have signed up from. For example, one way to end up in a data set is if a company sells your information to another company (for say, a mailing list).

Also, a data breach isn’t just considered just a login and password. It could also be your e-mail and zip code, e-mail and last four digits of a credit card number, or some other data which was tied to your identity.