I have been trying to understand how the CSMA P-persistent method works, but haven't been able to understand how it's implemented. I have referred to a few textbooks and other sources, but all of them just pass briefly over the concept.
In CSMA P-persistent ("probabilistic-persistent") a devices samples the line, and if idle transmits. If busy, samples it until it's idle and then transmits but only with a given probability.
The purpose of this is to reduce the conflicts of multiple devices wanting to transmit. Imagine an extreme situation: 1 minute frame transmission and 1000 devices: it's basically certain that more than one will want to transmit and will have detected the busy medium. They are all waiting for the frame to finish. Without the probabilistic condition, they'd all transmit with certain collision.
The various kinds of persistence are covered nicely at Wikipedia's CSMA article.