The answer (probably) is that the data is indeed shared, and the black magic part is where the synchronization between threads is handled. But there are people here who know much more about the perl threading system than me.
On my preferred system (linux) perl threads are just system threads (pthreads). That means that anything "below" the perl language view is shared by default, and the only thing keeping non-shared variables separate is the perl interpreter. That also means that it's much easier to have shared XS objects than shared perl objects (provided you handle your semaphores correctly), and conversely, it's pretty damn hard to handle non-shared XS objects correctly.