Sales really. It was a slow process, then DC did a Teen Titans series - which was their big franchise at the time - specifically for the direct market which took off. There's a bit more to it than that, but from memory that's the big thing.
Edit: Just to clarify that's more how the Direct Market happened, how the spinner racks and grocery stores got abandoned I can't remember.
I don't know why the racks disappeared either.
My Dad got me into reading in the first place by buying me comic books. Lord, how I wished I had kept them all from the time he started buying them for me!! I did the same for my son. Just went in one day and bought a whole bunch of old comics from a thrift store - "cartoon comics" - and just left them lying around. It wasn't long before he was picking them up and going through them. He'd ask for help with some of the words and he'd carry on his merry way. I just kept buying them, dozens at a time. Eventually, I went from the cartoon series to Superman, Batman, Spidey, etc. He ended up settling on pretty much all Marvel stuff -Spiderman and X-Men mostly, so I started buying him the comics off the racks in the stores. It just grew from there and he has carried on every since. He is in his 20s now and has one hell of a collection.