Shawshank wasn't a monster hit at the box office when it came out but it's legend began growing not long after. I remember reading that it was the most rented/purchased video cassette when it initially hit home video way back in those ancient times, and it has now cemented it's status as a bona fide cinema classic. But continuing to make money isn't unique to Shawshank. Most movies continue to get returns long after their theatrical run, from cable and network showings, dvd sales and rentals, etc.
I think I remember reading that Elizabeth Taylor's Cleopatra movie took thirty odd years to make money on it's gargantuan budget.
To expand on this: it wasn't a huge hit out the gate, but once it had been nominated for seven Academy awards (Nominees & Winners for the 67th Academy Awards | Academy of Motion Picture Arts & Sciences), it started to make money. Video and DVD sales are astonishing in the U.S. and the U.K.: 1 out of 5 households reportedly owns a copy of Shawshank.