I have referred to some on line dictionaries.connection and relationship seem to be synonymous and interchangeable in certain contexts.But they are not interchangeable some contexts.
India and America have a good relationship for the last 70 years.We can not say they have a good connection
The thieves have been arrested in connection with a robbery.
we can not use relationship year.
I have given some examples below to show the difference.
Relationship may refer to the connection because of blood or friendship.
How are you related?
We are cousins
How are you connected?
We make research together.
They have connections with the thieves.
Connection may be positive or negative. we may have connection due to a bad a cause or a good cause.
I think relationship is
usually positive.
We have usualy relationship for a good cause
Here are two links which help to know the difference or similarity between relationship and connection
https://dictionary.cambridge.org/amp/english/relationship
https://dictionary.cambridge.org/dictionary/english/connection