the most persistent source of such clashes was the right of the sovereign to appoint bishops in his realmknown as lay investiturewhich eventually came to a head and brought pope gregory vii and holy roman emperor henry iv to a deadlock in 1075 .