I read a very interesting paper named "The true story of Newtonian gravity"(1) and started to wonder about the law of gravity and one aspect of it, namely $r^2$ in $F_{g}=G\frac{{m_1}{m_2}}{{r^2}}$.
My question is how Kepler, Newton and Cavendish derived the $r^2$ term? Did they just accept the predecessors thinking or did they somehow experimentally or by mathematics come to that conclusion?
I'm sorry if i missed something in the paper, but it got me thinking.
(1) Hecht, E. (2021). The true story of Newtonian gravity. American Journal of Physics, 89(7), 683–692. https://doi.org/10.1119/10.0003535