Microscopic origin of the entropy of black holes in general relativity