When we define an abstract structure, establish theories or theorems, or build models, etc., we tend to want them to be "general" enough so they can be applied to a variety of situations. However, of course, more generality is not always better. Once generality passes a certain threshold, things become vague and useless.
Of course, we could treat this on a case-by-case, topic-by-topic basis. However, I wonder, is there or can there ever be a generalized / systematic approach to decide the optimal level of generality?
Here is an example in math. The following paragraph is from Kreyszig's Functional Analysis on how to generalize the concept of "distance",
In functional analysis we shall study more general "spaces" and "functions" defined on them. We arrive at a sufficiently general and flexible concept of a "space" as follows. We replace the set of real numbers underlying R on an abstract set X (set of elements whose nature is left unspecified) and introduce on X a "distance function" which has only a few of the most fundamental properties of the distance function on R. But what do we mean by "most fundamental"? This question is far from being trivial. In fact, the choice and formulation of axioms in a definition always needs experience, familiarity with practical problems and a clear idea of the goal to be reached. In the present case, a development of over sixty years has led to the following concept which is basic and very useful in functional analysis and its applications.
1.1-1 Definition (Metric space, metric). A metric space is a pair (X, d), where X is a set and d is a metric on X (or distance function on X), that is, a function defined on X × X such that for all x, y, z ∈ X we have:
(M1) d is real-valued, finite, and nonnegative
(M2) d(x, y) = 0 if and only if x = y
(M3) d(x, y) = d(y, x) [Symmetry]
(M4) d(x, y) ≤ d(x, z) + d(z, y) [Triangle Inequality]