"What gives a p-bass its sound?"
Define p-bass.
If you define it as a bass, made by Fender, that says "Precision" in its name, then I think it's pretty simple. Even if you limit it to Fender, and made in America.
By that definition, P basses have been made with ash and alder, so it's not one specific kind of wood. They've been made with maple and rosewood fretboards - slab and veneer. Necks that are quartersawn and necks that are, umm, whatever that other style is.

Bridges that are a bent plate and bridges that are "high mass". They've been made active and passive. With and without a J pickup. With nitrocellulose lacquer and polyurethane. Nitrocellulose pickguards and plastic. 4 and 5 string.
The only things I can see that are common to all P basses are:
- Pickup type
- Pickup placement
- 34" scale
- bolt-on neck
Beyond that, when I hear somebody say "that doesn't sound like a P bass", I interpret it to mean that it just doesn't sound like some specific P bass that they have in mind. But, if it has those 4 characteristics above, it probably sounds EXACTLY like some other actual Fender Made in America P bass somewhere.