In my case it's a combination of (a) graduating with money in the bank due to generous scholarships, and (b) having low expenses due to living in my parents' basement.
YCers, of course, are given a theoretical 3 months of living expenses and then usually get other investment at the end of the YC program -- so there's no mystery there (at least for those people for whom $5k == 3 months of living expenses).