It works by taking a small amount of the interest from all savings accounts and uses that money to pay out cash lottery prizes. It has been very successful in places where it has been tried, but local governments in the United States want to keep their lottery monopoly and prevent its adoption in this country.
For more information listen to (or read the transcript of) the Freakonomics Podcast