[noun] + と / に + 関係がある [noun] + と / に + 関係がない [noun] + と / に + 関係のある + [noun] [sentence] + こと + と / に + 関係がある
関係がある means "is related to", "has to do with": かんけい関係 is "connection", and ある says it exists. What it is connected to takes と or に.
と puts the two things side by side, so the link runs both ways. に points from one thing to the other, and suits "is involved in" an event or a matter.The negative says something has nothing to do with something else. In speech, が usually turns into は or drops out: かんけいない関係ない.
These go beyond saying that two things are connected.
Inside a clause that describes a noun, が often becomes の: かんけい関係のある, かんけい関係のない.