As my long-suffering better half said about me recently (to her psych no less): sometimes he just says and does things to see what kind of reaction it gets from people; to work them out, to understand their limits and motivations, to find their boundaries.
...and maybe even more accurately: just to entertain himself.
Certainly. The limits, the boundaries, are where there be dragons; excitement; life!
("Poo-Brown" as Colour starting with 'P' was the actual instigator)