So here is one common feature of P450s, the structural fold. The process by which xenobiotics are made more hydrophilic. The general reaction catalysed by P450s is a monooxygenation. Monooxygenation means the introduction of one oxygen. Once you increase a chemical's hydrophilicity, it can dissolve better in water and be removed by non-specific, common elimination processes, such as via the kidney.
Molecular oxygen is the other substrate and the second oxygen atom ends up in water.
This allows P450s to do a wide variety of chemical reactions using more or less similar chemistry. This is appropriate for a chemical defense system since different molecules have different structures and may need different reactions to make more polar. P450s catalyse types of reactions that are difficult for other enzymes. This property has made P450s very useful in a variety of different situations. While we will be interested in human P450s that metabolise drugs and other xenobiotics, it is important to keep in mind that P450s have evolved in almost all organisms known to fulfill a wide range of functional roles.