The goal of the paper is to offer an explanation why Frege has changed his Begriffsschrift account of identity to the one presented in Über Sinn und Bedeutung. The main claim of the paper is that in order to better understand Frege’s motivation for the introduction of his distinction between sense and reference, which marks his change of views, one should place this change in its original setting, namely the broader framework of Frege’s fundamental preoccupations with the foundations of arithmetic and logic. The Fregean thesis that mathematics is contentful, and its defense against formalism and psychologism, provides us an valuable interpretative key. Thus, Fregean senses are not just the mere outcome of some profound reflections on language, rather they play an important role in the articulation of Frege’s program in the foundations of arithmetic