Basically Catalonia, the region of Spain that includes Barcelona, is attempting to gain independence. The Spanish government is attempting to prevent that. These protests are a result of this tension.
It's worth noting that much of this "independence" business is not as serious as outsiders might assume. The Spanish government largely brought this 'independence' movement on themselves by rejecting requests for more sensible forms of increased local self-govenment. To a mildly-sophisticated observer, this just looks like a whole lot of overstated politicking. (This is also why PSOE - the party with the more "sensible" position within the Spanish govenment - is pushing for a soft approach. They realize that this will easily blow over as soon as the government comes to their senses.)
It’s also worth noting that Spain is already one of the most decentralised countries in the OCDE and Catalonia is one of the regions which a higher level of self-government in the country. Including its own police force, which results in the amusing situation that the regional government is at the same time encouraging the masses to revolt and sending the police to repress the revolts.
https://en.wikipedia.org/wiki/2019_Catalan_protests
https://en.wikipedia.org/wiki/2017_Catalan_independence_refe...