On the CPU side, the "root signature" is changed, which means that (on pre-D3D12 APIs), all the resource bindings must be re-sent to the GPU. The driver/runtime also might have to resubmit a bunch of pipeline state, and even validate that the PS / VS are compatible, etc (and possibly patch them if they mis-match, or patch the VS if it mis-matches with the IA config).... The driver might also have to do things like patch the PS if it doesn't match the current render-target format... :(
D3D12 helps here because you're aware of what's going on now -- you manage your own resource bindings and root signatures, instead of a general purpose runtime trying to guess the best way to manage them for you. It also doesn't do any validation when you bind a resource, so rebinding resources upon root-signature changes is cheaper.
On the GPU side, the front-end has to do a bunch of work to consume all those state/resource changes and get the GPU's cores ready to run with the new configuration. This work is generally pipelined, so the cost is free as long as there's no pipeline stalls... However, if the GPU's cores don't have enough work per draw-call, then they might finish their work before the front-end has configured the next pipeline state, forcing them to sit idle while that happens -- i.e. a pipeline bubble is formed.
On older GPU's I used to use the rule of thumb that a shader change (or other major pipeline state change) was OK as long as every batch covered at least 400 pixels. On modern GPU's I believe you can get away with more frequent switches than that. Some GPUs can even be preparing more than one pipeline config at a time, so you need to have ~8 "small batches" in a row in order to actually cause a pipeline bubble.