A P-pickup is a form of a humbucker: two coils with opposite wound coils and opposite pole magnets, so the signal gets through, but the hum is canceled out. Read these articles:
What Is a Humbucker and How Does It 'Buck' the Hum?
Anatomy Of A Humbucker - Seymour Duncan
How do Humbuckers Work? 60 Cycle Hum is a byproduct of Alternating Current and affects all guitars, so how does a Humbucker get rid of it?
www.fralinpickups.com
1) The humbucker was invented by Seth Lover of Gibson in the mid-1950's. It was not new technology. With the advent of neon bar signs and bad mains wiring, along with first generation amplifier technology, the P-90's were humming and buzzing badly. There always had been in radio a hum-cancelling choke coil design that eliminated high-frequency interference to tuned radio circuits. The genius of Seth Lover is that he figured out how to apply that to guitars. Gibson obtained a patent as soon as he could.
Seymour W. Duncan's Interview With Seth Lover - Seymour Duncan
2) Remember that Leo Fender started out as a radio repairman. So he had the RCA tube book, and because Gibson got the patent, he had to figure out another way to get his 1957 P-bass pickup through without it appearing to be a violation of the Gibson patent. Hence, the two coils, with each coil only sensing two strings.
Legendary Lows: The Precision Bass Story
3) In the meantime, Ray Butts was flying under the radar with his development of the Filter 'Tron for Gretsch. He was probably before Gibson, but Gretsch didn't actively pursue it.
In this archival interview, Gretsch's Ray Butts talks about his Filter'Tron, the EchoSonic amp, and other innovations.
reverb.com
4) And as a footnote, Rickenbacker had the double coil geometry on some of the earlier horseshoe magnet pickups, but not the realization that the pickup could be wired humbucking. The switch was an either/or for each coil, not together. I disagree with one point in this article: they were either/or, not both, or at least not both in series, unless modified afterwards:
The first modern Rickenbacker guitars
www.rickenbacker101.com
Now, to answer the OP's question about how to use them: everywhere for everything. They are simply another pickup. If you have a good eq on your amp, you can tailor the tone and gain characteristics to suit. The characteristics of two coils in series tend to increase the impedance, which to our ears sounds like an increase in mids, or making the tone a little thicker so if the tone is too thick, lower the lower mids or upper bass knob a number. If the coils are wired in parallel, that effectively halves the impedance, which our ears interpret as cutting mids, or making the tone sound a little thinner, If you want more guts in a parallel coil configuration, then raise the lower mids or upper bass knob a number. Finally, humbucking pickups may, in total, have a little more wire on them. Because of this, due to intra-coil capacitance, there may be a slight drop in highs, requiring about a half-number to a number more on the treble knob on the amp. No, humbuckers will never sound exactly the same as an equivalent vintage single coil. But that is not the point. The point is to get close, to eliminate garbage getting in the way of tone, and there won't be a noticable difference when run through most PA systems, whether small joint, concert hall, or arena. But what will be heard is the noise and hum, which must be eliminated to not cause garbage in what is coming out front to the audience.