Why is our definition of "smooth" function on a totally disconnected space the "right" definition? My main interest in this comes from starting to learn about representations of totally disconnected, locally compact topological groups $G$, and their representations. I came across the definition of "smooth" functions $\phi:G\to \mathbb{C}$ as being those which are locally constant, and smooth representations $G\to\text{End}(V)$ being those for which $\text{Stab}_G(v)$ is open for all $v\in V$.
These definitions lead me to two questions, which I suspect do not have technically precise answers, but for which I'm hoping there exists some good heuristic motivations.

*

*Why is the definition of "smooth" for functions $\phi:G\to\mathbb{C}$ the "right" definition?  That is, why is this considered to be the notion of functions on totally disconnected spaces that is analogous to the classic notion of smooth functions $f:\mathbb{R}\to\mathbb{R}$?


*in the same manner, why is the definition of smooth representations as above, the "right" analogue of smooth representations of Lie groups?
These don't seem totally alien to me given the nature of the topology of totally disconnected spaces, but I'm hoping someone can spin a narrative more convincing than just saying the definitions involved are very "pointy".
Also, I suspect that the answer to 2) will follow more or less directly from any reasonable answer to 1).
I'm happy to simply be directed to a source that has already laid this out.
 A: Of course, this is a reasonable question.
In my own experience, for example having thought about classical Hecke operators for some years before being exposed to the idea that they are integral operators attached to certain "smooth" functions on p-adic groups, and initially resisting that fancification of what I thought was an adequate and tangible idea, I've "been converted", and can explain why.
So, first, originally, Mordell and Hecke were very imaginative in considering classical "Hecke operators". As far as I know, this was a new idea.
Meanwhile, by the late 1940s and into the early 1950s, Iwasawa, Godement, Gelfand, and others were looking at very general topological groups, for somewhat philosophical reasons, as far as I can tell. There were great successes in reconsidering classical things in this context. In particular, Iwasawa's Math Congress talk on application of these ideas to (what we now call GL(1)-) zeta functions was striking. (Elaborated simultaneously in Tate's thesis.)
Part of the criteria to make the Iwasawa-Tate abstraction work was that it should certainly include Hecke's results... oh, and not make false claims. I really do suspect that this strongly back-formed definitions in the p-adic cases.
After that, and the Gelfand-PiatetskiShapiro stuff in the mid 1960s and Jacquet-Langlands c. 1970, people knew how to define things in these fancier situations to both recover the results they wanted (more simply), and prove stronger things.
I think that's the real explanation of "how we got here".
But/and there are also (I think substantially fake) rationalizations/explanations about totally disconnected groups being locally profinite, and the fact that functions on profinite groups that factor through limitands are locally finite... and that repns of profinite groups that similarly have factorization properties...  But all these things are actually after-the-fact, and were not at all the reasons for the "definitions", so far as I know.
I would be interested to hear of another thread which made these things seem more a-priori compelling! :)
EDIT: and, letting the other shoe drop, algebras of integral operators on representation spaces attached to "nice" functions on groups work very well, in a great variety of contexts, and for very general reasons. For one thing, once again, this idea does separate truly arithmetic things from stuff that's true for general reasons.
