Leo Tolstoy said this quote

Man lives consciously for himself but unconsciously he serves as an instrument for the accomplishment of historical and social ends.