Madrid enforcement seemed to be the shared responsibility of the police and army. We got pulled over near the airport and it was a roadblock with armed police. Large fines apparently of several thousand euros for failure to comply. We only got off because of the UK plates and my clear non understanding of the situation which my partner was able to explain in Spanish. The Spanish population seemed very willing to accept these harsh regulations. No doubt some on here will mouth off about being an overly obedient population isn't British etc but you've only got to look at how things are now in countries where the science has been followed.
Melbourne's rules were strong enough but I think most importantly, they were clear. Mandatory mask wearing in public, household visitor limits etc were consistently updated through daily briefings at the same time every day which most people found easy to follow. There was annoyance but as we saw it working I think people accepted it, up until the very end when the numbers were so low you could sense the good will elastic band was about to break. Then suddenly one morning in October, pubs were opened, households could up to ten visitors, 5km rule became 20km rule etc etc.