Raw pointers are going to give you a headache unless you rigorously manage them yourself - not saying you won’t, but often, especially in complex multi-threaded applications, you can trip over them. Forget to de-allocate, forget the move/share semantic, etc. Subtle bugs can manifest with raw pointers - the kind that should have been dustbin’ed decades ago. That said, use them if you really know what you’re doing. Most of the time, unique_ptr is a better choice, because scope is important in modern execution environments.
unique_ptr’s are a good ‘default’ choice to use, because they’re not reference counted and therefore don’t have the overhead typically associated with shared_ptr’s, and you can be sure that only one object will ‘own’ the pointer at a time - since you may only std::move them when you expect to.
shared_ptr’s are useful when you only use them when you know you need to share them between execution units, and any alloc’s associated with a shared_ptr will be tracked by the C++ runtime.
You use a unique_ptr in the processor, because this guarantees that only your processor object will have access to the objects referenced by them, ensuring the ‘uniqueness’ of accessing them during the life-cycle of your processing execution unit. In the context of audio processing, you really don’t want the APVTStates’ being modified out of context of the processing execution unit. You also don’t want any overhead (shared_ptr’s have a slight ‘cost’ of reference counting) during the processing execution unit, since audio is performance-dependent.
Raw pointers are useful when you need access to something that you won’t manage - you’re not going to be responsible for allocating the data, you just want to access it - to read values, and make ‘quick’ (non-reference counted) modifications in a ‘safe’ unit of execution. If you don’t ‘own’ the object referred to by the raw pointer, and are not ‘responsible’ for its alloc/de-alloc, and know that your execution unit will not be interrupted during the period of accessing the data behind the pointer, then raw pointers are fine to use.
In short, each pointer type has its uses. Its not a dumb question to ask ‘why?’ - you should know, intuitively, why. If you don’t feel like you understand it properly, its good to ask. As you proceed with larger and more sophisticated C++ projects, the good habits you pick up from the JUCE framework will serve you well …