Terahertz detection mechanisms in black phosphorus