As taught in High School Mathematics:
$$\begin{array}{ccl} \left\{ {(x-3)(x+3)\over 5(x+3)} : \ x\ne -3 \right\} & \ne & \left\{ {x-3\over 5} : \ x\in\mathbb{R} \right\} \\ \left\{ {(x-3)(x+3)\over 5(x+3)} : \ x\ne -3 \right\} & = & \left\{ {x-3\over 5} : \ x\ne -3 \right\} \end{array}$$
In order to truly say one rational expression is "equal" to another, when canceling variables in the denominator, we need to retain the conditions that make the domains equivalent as well.
Though from what I can tell Mathematica seems to have no problem with the potential for Zero in the Denominator.
For example I would have expected the following to give a conditional output where $x\ne -3$, but they don't:
In[]:= Cancel[((x - 3) (x + 3))/(5 (x + 3))]
Out[]= 1/5 (-3 + x)
In[]:= Reduce[((x - 3) (x + 3))/(5 (x + 3)) == (x - 3)/5, x]
Out[]= True
In[]:= Resolve[ForAll[{x}, ((x - 3) (x + 3))/(5 (x + 3)) == (x - 3)/5]]
Out[]= True
In[46]:= FunctionDomain[((x - 3) (x + 3))/(5 (x + 3)), x, Reals]
Out[46]= True
Etc.
On a practical level I can just manually add the assumptions. But I'd like to increase my familiarity with Mathematica and understand why this behavior arises in the first place.
Reduce
/Cancel
/Resolve
, etc because((x - 3) (x + 3))/(5 (x + 3))
automatically simplifies to1/5 (-3 + x)
before any of these functions are called. $\endgroup$Cancel
and related functions would be, for practical purposes, useless. Also it would not be correct in the sense of working over fields of rational functions. $\endgroup$