how does a country become independent