The difference is sales to strangers. Vanity publishing means printing and ordering books. After giving a few copies to friends and family, the undistributed books sit on a pallet in the garage. Indie publishing means getting a book into a distribution channel, like Amazon, where it can be bought by anyone. Sales to strangers is the key difference.
In the U.K., at least in the non-fiction and specialty markets, an author is often required to fund publication in part. It’s pay to play. So there at least, the distinction between paying for publication and being paid for publication breaks down. There is a lot of blurring at the edges of these definitions. Is a bookstore owner who publishes his friends (and himself) a self-publisher? What about City Lights Books?