The pointer variables pt and pd are stored on the stack. The values they point at, allocated with new, are stored on the heap.
If I write a sign with an arrow labelled “lake”, it doesn’t mean that the sign itself is a lake, nor that it must be mounted in a lake. Rather, it should be mounted on solid ground, pointing in the direction of the lake.