Nature of self-localization of Bose-Einstein condensates in optical lattices