

The centripetal force is actually due to the force of attraction between the sun and earth. Imagine there is no force of attraction between sun and the earth. In such a case, there will not be any centripetal force. That is why, we equate both these forces.
