text-gray-700 is not a font-weight, it's a color predetermined by the framework. They aren't generated, they are hand picked by a designer. Each addition of 100 is a bit darker.
https://tailwindcss.com/docs/customizing-colors/#default-col...
So essentially, what's the difference between style="color: gray;" and class="text-gray-500" is mostly that you get a more beautiful gray (they add a bit of blue in it).
I guess "text-sm" is also similar, with an hand picked size which appear nice on every device and can be considered "small text".