Intelligent glue

I spent a big chunk of today ripping cable trunking off the walls and trying to minimise the amount of wall which came came off with it. The trunking sections had been fitted with a special kind of glue which doesn’t grip when you want it to (the trunking kept falling down) but will hang on like grim death if you need to remove it. I wonder how they make it do that.